lua-users home
lua-l archive

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


tomas@ccpa.puc-rio.br wrote:
> Funny!  The following code does work:
> 
>   function foo()
>     local a
>     bar = function()
>       x = { b=2, a=1 }
>     end
>   end
> 
> But changing the order ( { a=1, b=2 } ) it doesn't.

Right, the first element is parsed in a different way because the
parser does not know what kind of constructor you are using:

	{ a=1,b=1 }  vs.  { a,b }

It has to see the '='.  But with a lookahead of 1 that's difficult...

Ciao, ET.