lua-users home
lua-l archive

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


On 16 December 2010 15:51, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> Here's a diff of the BNF as found in lparser.c:
>>
>> [...]
>
> Many thanks.
>
>
>> The changed syntax accepts strange stuff like
>>
>>    nil.foo
>>
>> but also nifty constructs like
>>
>>    "%d":format(42)
>>    { a, b, c }[i]
>
> This creates more cases of ambiguous syntax:
>
>  a = b + c
>  "%d":foo(42)
>

Even the example given by the OP could be ambiguous. Now I finally
have a reason for putting semi-colons in all my Lua code :)

Regards,
Matthew