lua-users home
lua-l archive

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

> According to luaconf.h, the value of the LUAI_MAXSHORTLEN value should not
> be smaller than 10, in order to cover keywords and metamethods. Is there
> any easy way to find where such cases occur in the source code?

I myself do not remember about metamethods ;) But about keywords, the
problem is not the comparsion; have a look at llex.c:430:

          if (ts->tsv.reserved > 0)  /* reserved word? */
            return ts->tsv.reserved - 1 + FIRST_RESERVED;

There is a field inside the string structure that tells whether that
string is a reserved word. If a string that is a reserved word does
not refer to the same structure that was properly initialized, the
lexer will not recognize it as a reserved word.

-- Roberto