diff options
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.27 2007/09/14 13:27:04 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.28 2007/10/25 16:45:47 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 | */ |
@@ -74,9 +74,6 @@ void luaX_init (lua_State *L) { | |||
74 | } | 74 | } |
75 | 75 | ||
76 | 76 | ||
77 | #define MAXSRC 80 | ||
78 | |||
79 | |||
80 | const char *luaX_token2str (LexState *ls, int token) { | 77 | const char *luaX_token2str (LexState *ls, int token) { |
81 | if (token < FIRST_RESERVED) { | 78 | if (token < FIRST_RESERVED) { |
82 | lua_assert(token == cast(unsigned char, token)); | 79 | lua_assert(token == cast(unsigned char, token)); |
@@ -107,8 +104,8 @@ static const char *txtToken (LexState *ls, int token) { | |||
107 | 104 | ||
108 | 105 | ||
109 | static void lexerror (LexState *ls, const char *msg, int token) { | 106 | static void lexerror (LexState *ls, const char *msg, int token) { |
110 | char buff[MAXSRC]; | 107 | char buff[LUA_IDSIZE]; |
111 | luaO_chunkid(buff, getstr(ls->source), MAXSRC); | 108 | luaO_chunkid(buff, getstr(ls->source), LUA_IDSIZE); |
112 | msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg); | 109 | msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg); |
113 | if (token) | 110 | if (token) |
114 | luaO_pushfstring(ls->L, "%s near %s", msg, txtToken(ls, token)); | 111 | luaO_pushfstring(ls->L, "%s near %s", msg, txtToken(ls, token)); |