lua-users home
lua-l archive

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


On Wed, May 9, 2018 at 3:19 PM Lorenzo Donati <lorenzodonatibz@tiscali.it> wrote:
I wouldn't mind if Lua allowed an optional syntax for specifying what
"end" ends; optional but enforced if used, i.e. an error would be issued
if (say) "end for" didn't end a for structure.

I can't say if it would be too heavy for the compiler or if a nice
syntax could be devised that didn't render the grammar too complicated

For example:

end for         (ambiguous)
vs.
end for;
vs.
end ---for      (semantic comments?)
vs.
end ::for::     (fake label? ambiguous)
vs.
<choose your poison!>

Just rambling, not a well fleshed-out RFE anyway.

I'm indifferent on putting this in the language syntax, but a version of it using magic comments might be a good feature in a static analysis tool such as luacheck.