lua-users home
lua-l archive

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


>   Do you think the table constructor syntax
> specification is easier to understand if it is rewritten as follows?
> 
> 
> tableconstuctory --> '{' [ fieldlist ] '}'
>        fieldlist --> lfieldlist [ ';' [ ffieldlist ] ]
>                   |  ffieldlist [ ';' [ lfieldlist ] ]
>       lfieldlist --> exp { ',' exp } [,]
>       ffieldlist --> ffield { ',' ffield } [,]
>           ffield --> '[' exp ']' '=' exp | name '=' exp


I guess the correct syntax would be more like

       fieldlist --> [ lfieldlist ] [ ';' [ ffieldlist ] ]
                  |  [ ffieldlist ] [ ';' [ lfieldlist ] ]

as things like {;}, {;12}, and {;a=1} are all valid...

-- Roberto