diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-12-05 17:57:00 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-12-05 17:57:00 -0200 |
| commit | eecc1491f39947d575fea42ec99864d9625d6e87 (patch) | |
| tree | c7b3e51d1d71724c22ea3c7cc2967876efd3b51b | |
| parent | 7ea68d84c4f7dbf82503a150a5b470808ad186ad (diff) | |
| download | lua-eecc1491f39947d575fea42ec99864d9625d6e87.tar.gz lua-eecc1491f39947d575fea42ec99864d9625d6e87.tar.bz2 lua-eecc1491f39947d575fea42ec99864d9625d6e87.zip | |
added some comments
| -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 | } |
