lua-users home
lua-l archive

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

Thomas Lauer wrote:
is almost 100% an error, so a warning might be appropriate... if the
compiler could warn.

I doubt most users would want a warning in regular script run, so I suppose we should get a flag to run scripts in a special warning mode, with an agressive lexer. Something like -Wall...

Or, perhaps, to have a lint for Lua (Lualint? Luint? Luaint? Lintua? Lintlua?), to avoid clutering regular lexer with such stuff. One that would warn against use of uninialized variables ("strict" mode), against functions with parameters of identical names (unlikely to happen anyway, or voluntarily to override a function while keeping a similar signature) and multiple identical local declarations (there was a discussion on the topic not so long ago, some might use actually this feature) and so on.

Having a LPeg grammar of Lua might help doing such tool... Although I recall some Lua parsers made in Lua were already made.

Philippe Lhoste
--  (near) Paris -- France
--  --  --  --  --  --  --  --  --  --  --  --  --  --