MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaX_token2str

Function luaX_token2str

freebsd/contrib/openzfs/module/lua/llex.c:72–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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