Jumping inside inner block with goto

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Jumping inside inner block with goto

Egor Skriptunoff-2
Hi!

Currently, the Lua manual says:
A label is visible in the entire block where it is defined
So, the following code is non-compilable:

goto L
if true then
   ::L::
end

It would be useful to allow "goto" to jump across block boundaries
(as long as it does not enter into the scope of a local variable).
In other words, a label should be visible in the current function,
not only in the current block.