Check for minus before converting to int.
BigInts converts "-" to 0. This happens in the parser before you get to the evaluator.
This commit is contained in:
parent
9d7a2a8fcb
commit
77b1638d64
|
|
@ -270,6 +270,8 @@ proc text_to_expression(text: string): JoyListType =
|
||||||
thing = j_true
|
thing = j_true
|
||||||
elif tok == "false":
|
elif tok == "false":
|
||||||
thing = j_false
|
thing = j_false
|
||||||
|
elif tok == "-": # see https://github.com/nim-lang/bigints/issues/116
|
||||||
|
thing = JoyType(kind: joySymbol, symVal: tok)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
thing = JoyType(kind: joyInt, intVal: tok.initBigInt)
|
thing = JoyType(kind: joyInt, intVal: tok.initBigInt)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue