aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2008-12-26 09:55:57 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2008-12-26 09:55:57 -0200
commit4c399c5dfbb094d4bd151d49abd3d998ed1d757d (patch)
treeea1b17069fd9e21589a3b94ae66092ba27df9c08
parentb47209849321b17e2037bfa46abf530e69bcc869 (diff)
downloadlua-4c399c5dfbb094d4bd151d49abd3d998ed1d757d.tar.gz
lua-4c399c5dfbb094d4bd151d49abd3d998ed1d757d.tar.bz2
lua-4c399c5dfbb094d4bd151d49abd3d998ed1d757d.zip
detail (MAXSRC changed to LUA_IDSIZE)
-rw-r--r--llex.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/llex.c b/llex.c
index d6c51acc..f0633b63 100644
--- a/llex.c
+++ b/llex.c
@@ -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
80const char *luaX_token2str (LexState *ls, int token) { 77const 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
109static void lexerror (LexState *ls, const char *msg, int token) { 106static 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));