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

@@ -413,6 +413,10 @@ private:
// and the result is: CH0*37^11 + CH1*37^10 + ... + CH11*37^0.
// This fixed-width encoding ensures that numeric ordering matches
// lexicographic ordering of the original strings.
//
// WARNING: The Lua lexer in llex.c contains a duplicate of this
// encoding logic (in the '@' token literal case). If you change
// the encoding here, you must update llex.c to match.
// Returns zero if the string is empty, too long, or contains
// invalid characters.
//

View File

@@ -64,7 +64,7 @@ public:
}
case LUA_TLIGHTUSERDATA: {
LuaToken token = LS_.cktoken(val);
(*output_) << "[" << token.str() << "]";
(*output_) << "@" << token.str();
return;
}
case LUA_TT_GENERAL: {