11 ms·
ok, so the semantics for lua goto's is to enter at the start of smallest enclosing block that has no free variables in the current environment? Or to statically
by carterschonwald 15y ago
ok, so the semantics for lua goto's is to enter at the start of smallest enclosing block that has no free variables in the current environment? Or to statically reject code that tries to do so? That doesn't sound quite accurate, unless you're saying that lua does some static analysis before execution, which I was not aware of.
- Dylan16807 15y agoLua compiles to a simple bytecode. It makes sure gotos are valid during this compilation. It jumps directly to the label, and can't skip forward over the declarations of variables that are in scope at the label.
- carterschonwald 15y agocool. Thanks for the info. Where are this and other features nicely documented?
- Dylan16807 15y agoI would suggest reading The Implementation of Lua 5.0 http://www.lua.org/doc/jucs05.pdf http://www.lua.org/doc/jucs05.pdf