aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/llex.c b/llex.c
index bb81cec4..226127f6 100644
--- a/llex.c
+++ b/llex.c
@@ -82,7 +82,10 @@ void luaX_init (lua_State *L) {
82const char *luaX_token2str (LexState *ls, int token) { 82const char *luaX_token2str (LexState *ls, int token) {
83 if (token < FIRST_RESERVED) { /* single-byte symbols? */ 83 if (token < FIRST_RESERVED) { /* single-byte symbols? */
84 lua_assert(token == cast_uchar(token)); 84 lua_assert(token == cast_uchar(token));
85 return luaO_pushfstring(ls->L, "'%c'", token); 85 if (lisprint(token))
86 return luaO_pushfstring(ls->L, "'%c'", token);
87 else /* control character */
88 return luaO_pushfstring(ls->L, "'<\\%d>'", token);
86 } 89 }
87 else { 90 else {
88 const char *s = luaX_tokens[token - FIRST_RESERVED]; 91 const char *s = luaX_tokens[token - FIRST_RESERVED];