Sublime Forum

Cannot Build Lua Script

#1

The following for-loop throws a syntax error in Sublime 2:

for i = 1,3 do print(i) end

File “/Users/…/test.lua”, line 1
for i = 1,3 do print(i) end
^
SyntaxError: invalid syntax
[Finished in 0.0s with exit code 1]

But it executes fine in Terminal:

for i = 1,3 do print(i) end
1
2
3

Please advise. I am new to Lua, but don’t see that this syntax has changed over the last few versions of Lua. How can one tell what version of a language is supported? And how do I get my code to build? Thanks so much in advance.

0 Likes