lua-users home
lua-l archive

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


Section 4.1 (Lexical Conventions) says:

 "The following words are reserved, and cannot be used as identifiers:"
 [list deleted]

Just to make it absolutely clear, it should also say: "identifiers are
represented by the terminal symbol name in the grammar.".

What tripped me up was trying to use "repeat" in a table constructor:

{ repeat = "AUTO", blah = "whatever"} because I didn't realise/forgot
that repeat was a keyword.  But now I think about it, it's ever so
slightly bogus to impose a non-reserved keyword restriction in table
constructors because they're supposed to be sugar for
["repeat"] = ...
but I can obviously see why it's like it is.

Cheers,
 djones