[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Disabling string interning in Lua
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sat, 6 Jul 2013 16:51:55 -0300
> 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