mmortatti / pico8-emulator

MIT License
27 stars 3 forks source link

if (...) shorthand is not properly handled. #77

Closed matheusmortatti closed 5 years ago

matheusmortatti commented 5 years ago

Right now it can handle most simple cases, but since regex cannot detect enclosing parenthesis it has a hard time dealing with cases like "if (sum(a, b) == 10) a = b".

What should be done is match a "if (..)" pattern and ignore enclosing parenthesis. The rest of the string should be matched to see if there is a 'then' keyword or nothing. In those cases it means that the shorthand is not being used.