Log In  


In 0.2.6 and earlier, this code snippet would print out hi.

if(true)--[[
]]print('hi')

In 0.2.6b, this is a syntax error instead

'then' expected near 'print'


I'm guessing the preprocessor removed the comment and the line-break inside it, whereas without the preprocessor, it IS seen as on another line.


I feel like it should probably work the way it currently does. It doesn't make sense to have a single-line if statement on multiple lines, even if there's a multiline comment in the middle of it (but also why would you need a multiline comment in the middle of a single line if statement?)


My use case for the old functionality is for tweetcarts. I use the comment trick to break a single-line if into multiple lines to enhance readability, but then I have a script that strips the comment out to "compile" the code to the minified tweetcart.



[Please log in to post a comment]