diff options
-rw-r--r-- | lparser.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.47 2006/09/14 12:59:06 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.48 2006/09/14 18:42:28 roberto Exp roberto $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -69,10 +69,12 @@ static void error_expected (LexState *ls, int token) { | |||
69 | 69 | ||
70 | 70 | ||
71 | static void errorlimit (FuncState *fs, int limit, const char *what) { | 71 | static void errorlimit (FuncState *fs, int limit, const char *what) { |
72 | const char *msg = (fs->f->linedefined == 0) ? | 72 | const char *msg; |
73 | luaO_pushfstring(fs->L, "main function has more than %d %s", limit, what) : | 73 | const char *where = (fs->f->linedefined == 0) ? |
74 | luaO_pushfstring(fs->L, "function at line %d has more than %d %s", | 74 | "main function" : |
75 | fs->f->linedefined, limit, what); | 75 | luaO_pushfstring(fs->L, "function at line %d", fs->f->linedefined); |
76 | msg = luaO_pushfstring(fs->L, "too many %s in %s (limit is %d)", | ||
77 | what, where, limit); | ||
76 | luaX_lexerror(fs->ls, msg, fs->ls->t.token); | 78 | luaX_lexerror(fs->ls, msg, fs->ls->t.token); |
77 | } | 79 | } |
78 | 80 | ||