diff options
| -rw-r--r-- | llex.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llex.c,v 2.60 2012/01/20 18:35:36 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.61 2012/01/23 23:05:51 roberto Exp roberto $ |
| 3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -73,16 +73,16 @@ void luaX_init (lua_State *L) { | |||
| 73 | 73 | ||
| 74 | 74 | ||
| 75 | const char *luaX_token2str (LexState *ls, int token) { | 75 | const char *luaX_token2str (LexState *ls, int token) { |
| 76 | if (token < FIRST_RESERVED) { | 76 | if (token < FIRST_RESERVED) { /* single-byte symbols? */ |
| 77 | lua_assert(token == cast(unsigned char, token)); | 77 | lua_assert(token == cast(unsigned char, token)); |
| 78 | return (lisprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) : | 78 | return (lisprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) : |
| 79 | luaO_pushfstring(ls->L, "char(%d)", token); | 79 | luaO_pushfstring(ls->L, "char(%d)", token); |
| 80 | } | 80 | } |
| 81 | else { | 81 | else { |
| 82 | const char *s = luaX_tokens[token - FIRST_RESERVED]; | 82 | const char *s = luaX_tokens[token - FIRST_RESERVED]; |
| 83 | if (token < TK_EOS) | 83 | if (token < TK_EOS) /* fixed format (symbols and reserved words)? */ |
| 84 | return luaO_pushfstring(ls->L, LUA_QS, s); | 84 | return luaO_pushfstring(ls->L, LUA_QS, s); |
| 85 | else | 85 | else /* names, strings, and numerals */ |
| 86 | return s; | 86 | return s; |
| 87 | } | 87 | } |
| 88 | } | 88 | } |
