lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

-----Ursprüngliche Nachricht-----
Von: "David Manura" <>
Gesendet: 16.06.2011 03:22:41
An: "Lua mailing list" <>
Betreff: Re: [ANN] Lua 5.2.0 (beta-rc1) GOTO

>On Wed, Jun 15, 2011 at 6:25 AM, Michael Rose <> wrote:
> ...
>Do you allow this?
> @ 123 f()
> @ 124 g()
> @ 123 h()

Yes, why not?
But in the current implementation the space between '@' and the linenumber is forbidden.
The linenumber correction has nothing to do with goto labels. Goto labels should be unique, but
compiler generated lines can be mapped arbitraryly to original source line numbers.
A possible generalization (not a big deal) as suggested in other e-mails would be

@123 "orig.lua"    or
@ 123 "orig.lua"   or even
@ 123
@ "orig.lua"

In contrast, labels shouldn't have embedded spaces and quote marks (") to be
distinguishable from line corrections:

@my-special-[goto]-label(123)>   (no space, no ("), printable characters)

Of course users should stick to labels like


but as I already said previously, its handy to have more complex labels for
compiler generated ones just to help inspecting generated code.

>lua-5.2.0-beta-rc1 doesn't allow the following analogue because label
>"line123" is redefined in the same scope:
> @ line123: f()
> @ line124: g()
> @ line123: h()
>(However, there is no need for Lua to care about this conflict because
>there is no goto targeting any of these labels.)


Michael Rose

Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut!