innogames / ax3

AS3 to Haxe converter
MIT License
43 stars 10 forks source link

if else parsing issue #10

Closed CrazyFlasher closed 3 years ago

CrazyFlasher commented 3 years ago

Such construction cannot be parsed

if (a == b)
  trace(1);
else
  trace(2);
nadako commented 3 years ago

This is a known parser limitation, similarly to unsupported ASI, the parser does not support semicolons at "arbitrary" places. It is recommended to wrap if/else and loop bodies into blocks to avoid issues like this.

Technically it's possiible to implement by adding token stacks and more lookahead, but we don't develop this project anymore, so feel free to do that in your own fork :)