lua-users home
lua-l archive

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


Michal Kolodziejczyk wrote:
> <snip> or use:
> tab[ [[var@addr]] ]=1

This made me wonder- is "a[[[b]]] = c" actually a syntactically
correct Lua statement? (it was rejected in every implementation I
tried)

Looking at the Lua 5.1 EBNF, I'd have interpreted this as:
    var `=´ Name
with
    var <=> prefixexp `[´ exp `]´ <=> Name `[´ String `]´ <=> `a´ `[´
`[[b]]´ `]´

Now I'm confused... Is my understanding of the EBNF broken, or was it
merely an implementation choice to not allow this?

--Wolfgang