lua-users home
lua-l archive

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


On May 19, 2012 9:44 AM, "Roberto Ierusalimschy" <roberto@inf.puc-rio.br> wrote:
>
> > I don't really consider this a bug (obviously) but hopefully Lua 5.2.1
> > can include this.
>
> Note that the syntax in Lua 5.2 changed; now a 'break' does not need to
> be the last statement in a block. So, there is no "optional semicolon"
> after the break, but an empty statement. All the following examples are
> valid now:
>
>  for i = 1, 2 do if true then break;;; end end
>  for i = 1, 2 do if true then break  a = 3 end end
>  for i = 1, 2 do if true then break;  a = 3 end end
>  for i = 1, 2 do if true then break;  ::label:: ; end end
>
> Some of those cases need the extra JMP, some do not. Some people may
> consider that "break;" is a common case to deserve a special treatment,
> but it would be better to handle the general case.

That makes sense. For now I'll just keep a patched version of Lua
while I look for an alternative solution for confirming source code
equivalence. It's a little disappointing luac can't make this easier.

--
- Patrick Donnelly