gnue / NEWT0

NewtonScript
http://gnue.github.io/NEWT0
34 stars 13 forks source link

Negative constants encoded incorrectly #22

Open ekoeppen opened 4 years ago

ekoeppen commented 4 years ago

newt -e 'print(-1)' prints -4 instead of -1. newt -e 'print(0 - 1)' on the other hand works properly.

gnue commented 4 years ago

orz...

Just fixed e2008dc816ac33561de251f94f6404214a8f7146

https://github.com/gnue/NEWT0/blob/e2008dc816ac33561de251f94f6404214a8f7146/src/newt_core/NewtVM.c#L2715 https://github.com/gnue/NEWT0/blob/e2008dc816ac33561de251f94f6404214a8f7146/src/newt_core/NewtObj.c#L860