You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.
I tried making some test-cases + fixing up the check for empty nodes by checking over every descendent node rather than just the first, but my do-while case is failing completely for magic-string reasons I don't fully understand.
Additionally, all cases where a curly-braced loop could be reduced to a single-statement body aren't working because I can't figure out how to trim leading/trailing EmptyStatements.
Incidentally it looks like there's a few more cases where leading empty statements in a block change the output (e.g. if (a) { b(); } vs if (a) { ; b(); }) but the loops are the only case where it's doing something it definitely shouldn't.
The text was updated successfully, but these errors were encountered:
Thanks. It was operating under the incorrect assumption that if the first statement of the body was an EmptyStatement, the body itself was empty. It should really remove empty statements altogether — will get to that soon — but #59 generates correct if suboptimal code
e.g.
while (a) { ; b(); }
->while(a);;
(link)I tried making some test-cases + fixing up the check for empty nodes by checking over every descendent node rather than just the first, but my do-while case is failing completely for magic-string reasons I don't fully understand.
Additionally, all cases where a curly-braced loop could be reduced to a single-statement body aren't working because I can't figure out how to trim leading/trailing
EmptyStatement
s.Incidentally it looks like there's a few more cases where leading empty statements in a block change the output (e.g.
if (a) { b(); }
vsif (a) { ; b(); }
) but the loops are the only case where it's doing something it definitely shouldn't.The text was updated successfully, but these errors were encountered: