MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaX_token2str

Function luaX_token2str

depends/lua/src/llex.c:82–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80
81
82const char *luaX_token2str (LexState *ls, int token) {
83 if (token < FIRST_RESERVED) { /* single-byte symbols? */
84 lua_assert(token == cast_uchar(token));
85 return luaO_pushfstring(ls->L, "'%c'", token);
86 }
87 else {
88 const char *s = luaX_tokens[token - FIRST_RESERVED];
89 if (token < TK_EOS) /* fixed format (symbols and reserved words)? */
90 return luaO_pushfstring(ls->L, "'%s'", s);
91 else /* names, strings, and numerals */
92 return s;
93 }
94}
95
96
97static const char *txtToken (LexState *ls, int token) {

Callers 3

txtTokenFunction · 0.85
error_expectedFunction · 0.85
check_matchFunction · 0.85

Calls 1

luaO_pushfstringFunction · 0.85

Tested by

no test coverage detected