| 80 | |
| 81 | |
| 82 | const 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 | |
| 97 | static const char *txtToken (LexState *ls, int token) { |
no test coverage detected