Add token literals to the lua parser

This commit is contained in:
2026-02-19 00:11:44 -05:00
parent 1fd06f0628
commit 7039c43065
8 changed files with 58 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ enum RESERVED {
TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,
/* other terminal symbols */
TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_DBCOLON, TK_EOS,
TK_NUMBER, TK_NAME, TK_STRING
TK_NUMBER, TK_NAME, TK_STRING, TK_TOKEN
};
/* number of reserved words */
@@ -37,6 +37,7 @@ enum RESERVED {
typedef union {
lua_Number r;
TString *ts;
void *p; /* for token (lightuserdata) literals */
} SemInfo; /* semantics information */