lua-users home
lua-l archive

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


>          Component
>          { (*** line 39 ***)
>               parent = "PlayGUI",
>               type = "TextLabel"
>          }
>}
>
>
>
>> It doesn't work. Lua complains:
>
>Interesting... without looking at the Lua parser or trying anything, my
>hunch
>is that you're running into a line-end-aware issue introduced with Lua 5.
>
>Try doing the way I suggested, with
>      children = { Component { }, Component { } }

That's right, but it has nothing to do with line-ends. In Lua 4.0, you cannot
mix named and anonymous members in tables: you must separate them with a ";":

	{ x=1, y=2, z="lua" ; 10, 20, 30 }

In the example in this thread, Component{...} introduces a anonymous member.
So try adding a ";" before it.

In Lua 5.0, you can freely mix members.
--lhf