diff options
author | Clément Pit--Claudel <clement.pitclaudel@live.com> | 2015-06-07 02:22:02 -0700 |
---|---|---|
committer | Clément Pit--Claudel <clement.pitclaudel@live.com> | 2015-06-07 02:22:02 -0700 |
commit | 1e9a9af1700f67dde62e8ceb81aa16e13de0e3fb (patch) | |
tree | 11865312bfb5cefd285fc4504153da618f700376 /Source/Dafny/Parser.cs | |
parent | a74ff7e873f3db35baf590c8221c2f460b49d07b (diff) |
Add a compatibility layer over BigInteger.Parse
Mono currently does not implement support for BigInteger.Parse, so use Int64 if
possible, and throw the same error as was previously returned otherwise. This is
not too much of a problem in practice, because most of the integers that we
actually come across in real-life source files seem to fit in an Int64.
Diffstat (limited to 'Source/Dafny/Parser.cs')
-rw-r--r-- | Source/Dafny/Parser.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Dafny/Parser.cs b/Source/Dafny/Parser.cs index fa41877f..b183fff1 100644 --- a/Source/Dafny/Parser.cs +++ b/Source/Dafny/Parser.cs @@ -3988,7 +3988,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo Get();
S = Util.RemoveUnderscores(t.val);
try {
- n = BigInteger.Parse(S);
+ n = BigIntegerParser.Parse(S);
} catch (System.FormatException) {
SemErr("incorrectly formatted number");
n = BigInteger.Zero;
@@ -3999,7 +3999,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo S = Util.RemoveUnderscores(t.val.Substring(2));
try {
// note: leading 0 required when parsing positive hex numbers
- n = BigInteger.Parse("0" + S, System.Globalization.NumberStyles.HexNumber);
+ n = BigIntegerParser.Parse("0" + S, System.Globalization.NumberStyles.HexNumber);
} catch (System.FormatException) {
SemErr("incorrectly formatted number");
n = BigInteger.Zero;
|