lua-users home
lua-l archive

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


Generally speaking, the most limiting feature of Lua syntax, when you want to extend/modify it, is the lack of mandatory statement separators. If you think of a random extension, 3/4 of the time it will introduce statement separation ambiguities, sometimes hard to suppress. The usual way to fix this is to use dedicated keywords to introduce statements, which can't appear in an _expression_: here that would be choosing method introduction keyword other than "-".

Since you're going to break source compatibility anyway, I'd suggest that you make the ";" statement separators mandatory.  Since your program's purpose is to clarify sources, I fear that introducing contrived rules to resolve parsing ambiguities would defeat its main purpose.

Note that mandatory separators would also solve your index/invocation ambiguity; here again, the other clean alternative would be to use another keyword than "[" to introduce invocations.

    -- Fabien.