[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: From C, checking script syntax
- From: Mark Hamburg <mark@...>
- Date: Sun, 29 Nov 2009 17:47:59 -0800
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).