On Sun, Jan 12, 2014 at 8:40 AM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> $ lua -e "if x then"
>> lua: (command line):1: 'end' expected near <eof>
It seems that this is caused by the lack of end of line in the chunk
because this works fine:
$ lua -e "if x then^M"
lua: (command line):2: 'end' expected (to close 'if' at line 1) near <eof>
(here I've typed ^V^M to get a newline in the string.)
Compare also
$ echo 'if x then' | lua -
lua: stdin:2: 'end' expected (to close 'if' at line 1) near <eof>
$ echo -n 'if x then' | lua -
lua: stdin:1: 'end' expected near <eof>
Indeed. Seems Lua outsmarted me again! :)
Sent from my Game Boy.