diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-12-26 09:55:57 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-12-26 09:55:57 -0200 |
commit | 4c399c5dfbb094d4bd151d49abd3d998ed1d757d (patch) | |
tree | ea1b17069fd9e21589a3b94ae66092ba27df9c08 | |
parent | b47209849321b17e2037bfa46abf530e69bcc869 (diff) | |
download | lua-4c399c5dfbb094d4bd151d49abd3d998ed1d757d.tar.gz lua-4c399c5dfbb094d4bd151d49abd3d998ed1d757d.tar.bz2 lua-4c399c5dfbb094d4bd151d49abd3d998ed1d757d.zip |
detail (MAXSRC changed to LUA_IDSIZE)
-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)); |