lua-users home
lua-l archive

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




On Wednesday, May 6, 2015, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> I always wondered: is there a reason why this syntax is not supported?
> (Other than vacuously-true answers such as "it wasn't implemented that
> way" or "because the grammar disallows it")
>
> In other words, does disallowing it prevent a bad grammar ambiguity,
> or something like that?

It prevents a grammar ambiguity (whether it is "bad" is up to taste):
The code
  a = b   "xy":foo()
could be
  a = b; "xy":foo()
or
  a = b"xy":foo()

The same already happens with parentheses, but that would create yet
another ambiguity.

-- Roberto


Thank you for this explanation. 

-Andrew