lua-users home
lua-l archive

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

-----Ursprüngliche Nachricht-----
Von: "Pierre-Yves Gérardy" <>
Gesendet: 16.06.2011 11:36:51
An: "Lua mailing list" <>
Betreff: Re: [ANN] Lua 5.2.0 (beta-rc1) GOTO

>On Thu, Jun 16, 2011 at 10:10, Michael Rose <> wrote:
> ...
>You could hard code the "|" and "]" tokens in the parser and get rid
>of the second and third @ which are bulky and redundant (they're not
>needed for a non-ambiguous grammar).
>var = @[ statements | expresion ]

True. This could be done. But this would tighten the currently non-used '|' to this construct,
which is mainly used to support compiler generated code. There are only a few
nonused characters and we should be careful not to waste them.
If this construct should go into standard Lua, I would prefer keywords instead, e.g.

   stat <statements> expr <expr> end

For compiler generated code the '@[ ... @| ... @]' syntax doesn't hurt and has the
advantage, that only the '@' sign is needed to generate the extra tokens.

>-- Pierre-Yves


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