When a short-form "if" is directly followed by an "end", it causes an error:
function test(x) if (x==1) print "boo" end test(1) |
Inserting a newline before the "end" fixes it:
function test(x) if (x==1) print "boo" end test(1) |
v0.1.0 on Windows
Fixed for the next update (0.1.1)
An alternative workaround in the meantime is to put indentation before the if:
function test(x) if (x==1) print "boo" end test(1) |
is also ok.
Apologies anyone who got stumped by this bug and the cryptic <eof> error message. So confusing!
Actually, I did write it this way (indented), but it was somehow trimmed away upon pasting the code.
I just tested it again, and indenting doesn't change the behavior for me; only the newline does.
Another interesting thing about the short-if is that a space is required between the ")" and expression,
if(w==nil) w=1 -- OK if(w==nil)w=1 -- Error |
[Please log in to post a comment]