Syntax: support multiprecision integer literals (#58)
* Syntax: support multiprecision integer literals
* Using INT token type for both cases
the parser is handling int64 and *big.Int values as a token of the type INT
* Tests for bigInt
* Testing large integer literals
* Deleting some comments
* Fixing a space
diff --git a/syntax/parse.go b/syntax/parse.go
index e4c5644..45bc7ab 100644
--- a/syntax/parse.go
+++ b/syntax/parse.go
@@ -778,7 +778,11 @@
tok := p.tok
switch tok {
case INT:
- val = p.tokval.int
+ if p.tokval.bigInt != nil {
+ val = p.tokval.bigInt
+ } else {
+ val = p.tokval.int
+ }
case FLOAT:
val = p.tokval.float
case STRING: