diff options
| -rw-r--r-- | llex.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llex.c,v 2.24 2007/02/07 17:49:18 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.25 2007/05/11 17:28:56 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 | */ |
| @@ -77,8 +77,8 @@ void luaX_init (lua_State *L) { | |||
| 77 | const char *luaX_token2str (LexState *ls, int token) { | 77 | const char *luaX_token2str (LexState *ls, int token) { |
| 78 | if (token < FIRST_RESERVED) { | 78 | if (token < FIRST_RESERVED) { |
| 79 | lua_assert(token == cast(unsigned char, token)); | 79 | lua_assert(token == cast(unsigned char, token)); |
| 80 | return (iscntrl(token)) ? luaO_pushfstring(ls->L, "char(%d)", token) : | 80 | return (isprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) : |
| 81 | luaO_pushfstring(ls->L, LUA_QL("%c"), token); | 81 | luaO_pushfstring(ls->L, "char(%d)", token); |
| 82 | } | 82 | } |
| 83 | else { | 83 | else { |
| 84 | const char *s = luaX_tokens[token - FIRST_RESERVED]; | 84 | const char *s = luaX_tokens[token - FIRST_RESERVED]; |
