Re: Ambiguous syntax
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Ambiguous syntax
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2012年12月12日 11:44:33 -0200
> There's no honest ambiguity in the syntax -- it's just a question of
> protecting against likely bugs.
>
> f()
> (g or h)()
>
> is naturally read as 2 statements, though given Lua's grammar it should be
> parsed as just one.
I think Lua's grammar allows that code to be read as two statements; it
is a very "honest" ambiguity.
-- Roberto