[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: detecting undefined variables--a new mixed approach
- From: David Manura <dm.lua@...>
- Date: Tue, 25 Mar 2008 03:36:53 +0000 (UTC)
Luiz Henrique de Figueiredo writes:
> most if not all of what you propose can be implemented in Lua using
> my bytecode inspector library, lbci.
All, actually. A reimplementation of the modified debug.getinfo using lbci is
now on the DetectingUndefinedVariables page. The code uses
inspector.getinstruction, inspector.getconstant, and inspector.getfunction
functions, and if checkglobals(f, env) is called with f as a stack number
(default f = 1), it still needs to call debug.getinfo(f, 'f').func. lbci has
somewhat more than one needs here, at a lower level and as a separate C library,
but it works fairly well.
(BTW, I'm not really sure what else lbci could be used for, but if it allowed
modification of bytecodes, such as an assembler, then things could get more