vsariola / pakettic

TIC-80 cartridge packer
MIT License
19 stars 4 forks source link

fix: Parse error when --{ looks like subtraction #12

Closed dezgeg closed 10 months ago

dezgeg commented 10 months ago

Minimal failing example:

n=n+n
--{
f()
--}

This fails to parse because '--{' in this context looks like subtraction by a negated table constant.

Also, the parser currently allows 'f(--{})' (f called with double-negated table constant), forbid that as well.

vsariola commented 10 months ago

Thanks! I'll look into this and merge asap

vsariola commented 10 months ago

LGTM, thanks! Your tests fail without the fix, and with the fix, everything passes & corpus parses ok, so seems legit.