error message
This commit is contained in:
12
lparser.c
12
lparser.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lparser.c,v 2.47 2006/09/14 12:59:06 roberto Exp roberto $
|
** $Id: lparser.c,v 2.48 2006/09/14 18:42:28 roberto Exp roberto $
|
||||||
** Lua Parser
|
** Lua Parser
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -69,10 +69,12 @@ static void error_expected (LexState *ls, int token) {
|
|||||||
|
|
||||||
|
|
||||||
static void errorlimit (FuncState *fs, int limit, const char *what) {
|
static void errorlimit (FuncState *fs, int limit, const char *what) {
|
||||||
const char *msg = (fs->f->linedefined == 0) ?
|
const char *msg;
|
||||||
luaO_pushfstring(fs->L, "main function has more than %d %s", limit, what) :
|
const char *where = (fs->f->linedefined == 0) ?
|
||||||
luaO_pushfstring(fs->L, "function at line %d has more than %d %s",
|
"main function" :
|
||||||
fs->f->linedefined, limit, what);
|
luaO_pushfstring(fs->L, "function at line %d", fs->f->linedefined);
|
||||||
|
msg = luaO_pushfstring(fs->L, "too many %s in %s (limit is %d)",
|
||||||
|
what, where, limit);
|
||||||
luaX_lexerror(fs->ls, msg, fs->ls->t.token);
|
luaX_lexerror(fs->ls, msg, fs->ls->t.token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user