MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaX_token2str

Function luaX_token2str

third-party/lua-5.2.4/src/llex.c:75–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74
75const char *luaX_token2str (LexState *ls, int token) {
76 if (token < FIRST_RESERVED) { /* single-byte symbols? */
77 lua_assert(token == cast(unsigned char, token));
78 return (lisprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) :
79 luaO_pushfstring(ls->L, "char(%d)", token);
80 }
81 else {
82 const char *s = luaX_tokens[token - FIRST_RESERVED];
83 if (token < TK_EOS) /* fixed format (symbols and reserved words)? */
84 return luaO_pushfstring(ls->L, LUA_QS, s);
85 else /* names, strings, and numerals */
86 return s;
87 }
88}
89
90
91static const char *txtToken (LexState *ls, int token) {

Callers 3

txtTokenFunction · 0.70
error_expectedFunction · 0.70
check_matchFunction · 0.70

Calls 1

luaO_pushfstringFunction · 0.70

Tested by

no test coverage detected