diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-10-24 10:31:48 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-10-24 10:31:48 -0300 |
commit | 9f5a052c27a3182bb29250b99fd622cf9ae5f965 (patch) | |
tree | 132f2a416be65bbe76c6f74817bd3b71a22ea869 /lparser.c | |
parent | fc875334fdc2497e90969ceed1851004d9baf3c5 (diff) | |
download | lua-9f5a052c27a3182bb29250b99fd622cf9ae5f965.tar.gz lua-9f5a052c27a3182bb29250b99fd622cf9ae5f965.tar.bz2 lua-9f5a052c27a3182bb29250b99fd622cf9ae5f965.zip |
error message
Diffstat (limited to 'lparser.c')
-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 | ||