lua-users home
lua-l archive

Re: Ambiguous syntax

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


On Wed, Dec 12, 2012 at 10:17 AM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
> As shown here, the check was confusing anyway. There are several valid
> situations where you may want a newline between the function and the
> parameters. Moreover, in 5.2, you can always add a colon before the
> statement to avoid ambiguity:
so, the new syntax means
f()
(g or h)()
would always compile to a single statement without error, and (likely)
fail at runtime if f() doesn't return a function. right?
if so, what would be the rule of thumb to prevent this? i'm guessing
something like "if your statement line starts with an opening
parenthesis, better add a semicolon before it"
--
Javier

AltStyle によって変換されたページ (->オリジナル) /