lightscript icon indicating copy to clipboard operation
lightscript copied to clipboard

single line do-while loop requires ;

Open plexigras opened this issue 8 years ago • 2 comments

do …; while … works but do … while … doesn't.

plexigras avatar Mar 25 '18 14:03 plexigras

Iirc there was a grammar ambiguity otherwise. I don't recall what it was, might be possible to tell from the tests.

rattrayalex avatar Mar 26 '18 11:03 rattrayalex

For the record, there is no grammar ambiguity here as of ES2016 (as far as I can tell, anyway) since while is a keyword. I fixed this one by adding while to the canInsertSemicolon whitelist, as I have with other illiberal ASI cases.

(There may be grammar ambiguities with do expressions enabled.)

wcjohnson avatar May 15 '18 07:05 wcjohnson