| 73 | |
| 74 | |
| 75 | const 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 | |
| 91 | static const char *txtToken (LexState *ls, int token) { |
no test coverage detected