[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: From C, checking script syntax
- From: Mark Hamburg <mark@...>
- Date: Mon, 30 Nov 2009 22:05:50 -0800
On Nov 30, 2009, at 2:37 AM, Luiz Henrique de Figueiredo wrote:
>> 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).
>
> See http://lua-users.org/lists/lua-l/2006-10/msg00206.html
Thanks. And the reason I remembered its existence if not its details was, of course, that it was an answer to my own question. I've just sort of weaned myself off of running with a modified Lua implementation as much as possible since the modifications make upgrades harder. So, I end up looking at where one could put the code but then not adding it. I should probably maintain two projects. One for work destined for delivery -- i.e., long life -- and one with a thoroughly hacked up Lua implementation.
Mark