Scanner and parser use different tables for constants
Moreover, each function being parsed has its own table. The code is cleaner when each table is used for one specific purpose: The scanner uses its table to anchor and unify strings, mapping strings to themselves; the parser uses it to reuse constants in the code, mapping constants to their indices in the constant table. A different table for each task avoids false collisions.
This commit is contained in:
2
ltable.h
2
ltable.h
@@ -154,8 +154,6 @@ LUAI_FUNC lu_byte luaH_getint (Table *t, lua_Integer key, TValue *res);
|
||||
/* Special get for metamethods */
|
||||
LUAI_FUNC const TValue *luaH_Hgetshortstr (Table *t, TString *key);
|
||||
|
||||
LUAI_FUNC TString *luaH_getstrkey (Table *t, TString *key);
|
||||
|
||||
LUAI_FUNC int luaH_psetint (Table *t, lua_Integer key, TValue *val);
|
||||
LUAI_FUNC int luaH_psetshortstr (Table *t, TString *key, TValue *val);
|
||||
LUAI_FUNC int luaH_psetstr (Table *t, TString *key, TValue *val);
|
||||
|
||||
Reference in New Issue
Block a user