lua-users home
lua-l archive

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

There are a couple of approaches:

1. Take the byte code generated by load followed by dump, scan it for access to globals, and complain if there are any values not on your list. See the various discussions of "linting" Lua.

2. If you are prepared to modify the compiler, I think that it's actually possible to move that check into the compiler itself.

So, this is entirely doable but it isn't trivial since what you are looking for isn't a syntax error (though option 2 makes it one).