diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-05-13 09:03:26 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-05-13 09:03:26 -0300 |
commit | 0d00729e316dd7cd9a1b00ae716761eef8f00dfe (patch) | |
tree | 2980c8f7c251fe40072d5d9712a12b822242ee13 | |
parent | b6e9fcbd70b8e006417ef771f9789d54d075b552 (diff) | |
download | lua-0d00729e316dd7cd9a1b00ae716761eef8f00dfe.tar.gz lua-0d00729e316dd7cd9a1b00ae716761eef8f00dfe.tar.bz2 lua-0d00729e316dd7cd9a1b00ae716761eef8f00dfe.zip |
detail (breaking a long line)
-rw-r--r-- | lparser.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.82 2010/04/05 16:35:37 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.83 2010/04/17 12:46:32 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 | */ |
@@ -74,9 +74,10 @@ static void error_expected (LexState *ls, int token) { | |||
74 | 74 | ||
75 | static void errorlimit (FuncState *fs, int limit, const char *what) { | 75 | static void errorlimit (FuncState *fs, int limit, const char *what) { |
76 | const char *msg; | 76 | const char *msg; |
77 | const char *where = (fs->f->linedefined == 0) ? | 77 | int line = fs->f->linedefined; |
78 | "main function" : | 78 | const char *where = (line == 0) |
79 | luaO_pushfstring(fs->L, "function at line %d", fs->f->linedefined); | 79 | ? "main function" |
80 | : luaO_pushfstring(fs->L, "function at line %d", line); | ||
80 | msg = luaO_pushfstring(fs->L, "too many %s (limit is %d) in %s", | 81 | msg = luaO_pushfstring(fs->L, "too many %s (limit is %d) in %s", |
81 | what, limit, where); | 82 | what, limit, where); |
82 | luaX_syntaxerror(fs->ls, msg); | 83 | luaX_syntaxerror(fs->ls, msg); |