lua-users home
lua-l archive

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


Jerome Vuarand <jerome.vuarand@gmail.com> writes:

> 2011/6/13 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
>>> Why break can appear middle of block but not return?
>>
>> Because return may be followed by an optional expression. Something
>> like 'return a       = 3' would confuse the parser.
>
> But then shouldn't "return; a = 3" be allowed ?

Take a look at the BNF syntax of Lua and propose a simple modification
that has that effect.

-- 
David Kastrup