egordorichev / pemsa

Runtime emulation for PICO-8
MIT License
101 stars 4 forks source link

+=, /=, etc. should respect order of operations #8

Open cominixo opened 3 years ago

cominixo commented 3 years ago

These tokens should be processed with parentheses around the second value, for example, from a += b to a = a + (b), otherwise something like this:

a=2
a=a/(7-4/2)
print(a)
a=2
a/=7-4/2
print(a)

will print different things in pemsa, but they're the same value in PICO-8.

egordorichev commented 3 years ago

Man, I guess we do need a more advanced lua parser