lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I thought the parser warned about such ambiguous statements as in your example, and your suggestion allows for exactly the kind of ambiguity it was intended to disallow?

Interesting.  It looks like the "ambiguous syntax" error message is something that was taken out in 5.2.  

On a 5.1 parser, I think my example will indeed emit an error message.  But I've now spent most of my life as a lua programmer working in 5.2, however, where the code:

f()
(g or h)(2)

appears to be both legal and a likely bug.

Some searching in the list archives reveals that this is something we've noticed before -- but, I've yet to encounter any hints about why the change was made.

If the "ambiguous syntax" message had been keep inside 5.2, I probably never would have been tempted to start playing with my own versions of newline sensitivity.

Though now that I have started down this particular rabbit hole, I think I may prefer splitting the statement to patching my 5.2 parser to emit 5.1 style errors.

-Sven