MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaX_token2str

Function luaX_token2str

lib/lua/src/llex.c:82–96  ·  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 if (lisprint(token))
85 return luaO_pushfstring(ls->L, "'%c'", token);
86 else /* control character */
87 return luaO_pushfstring(ls->L, "'<\\%d>'", token);
88 }
89 else {
90 const char *s = luaX_tokens[token - FIRST_RESERVED];
91 if (token < TK_EOS) /* fixed format (symbols and reserved words)? */
92 return luaO_pushfstring(ls->L, "'%s'", s);
93 else /* names, strings, and numerals */
94 return s;
95 }
96}
97
98
99static 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