lua-users home
lua-l archive

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


> But the best parser is, well, Lua itself!! Deep inside Lua is a block of code that knows when it has a global variable and converts "x" to "_ENV.x" .. that's fundamental to the way the language works now. It seems to me that the best approach would be to modify luac and add a switch to get it to emit a line of output each time it prefixes "_ENV" onto a global/free variable. Something like the line number, column number, and variable name. With this as input, it should be easy to create analysis tools that then provided information on globals usage (that mis-spelled global would easily be found).

See this thread and the ones it links to for a roadmap:
	http://lua-users.org/lists/lua-l/2011-09/msg00684.html