diff options
author | Mike Pall <mike> | 2012-09-28 18:12:43 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-09-28 18:12:43 +0200 |
commit | 550ac44e41ad430f8a355533bf03cf04b61bb266 (patch) | |
tree | 86f244ef8d9962be173af4c698b1245f22b1ee34 /src | |
parent | 7a6bb9a20836107cd715a818072cbbd1c8eac516 (diff) | |
download | luajit-550ac44e41ad430f8a355533bf03cf04b61bb266.tar.gz luajit-550ac44e41ad430f8a355533bf03cf04b61bb266.tar.bz2 luajit-550ac44e41ad430f8a355533bf03cf04b61bb266.zip |
From Lua 5.2: Remove error for ambiguous function call syntax.
Needs -DLUAJIT_ENABLE_LUA52COMPAT.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_errmsg.h | 2 | ||||
-rw-r--r-- | src/lj_parse.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/lj_errmsg.h b/src/lj_errmsg.h index f368da5a..7097f5e3 100644 --- a/src/lj_errmsg.h +++ b/src/lj_errmsg.h | |||
@@ -135,7 +135,9 @@ ERRDEF(XLIMF, "function at line %d has more than %d %s") | |||
135 | ERRDEF(XMATCH, LUA_QS " expected (to close " LUA_QS " at line %d)") | 135 | ERRDEF(XMATCH, LUA_QS " expected (to close " LUA_QS " at line %d)") |
136 | ERRDEF(XFIXUP, "function too long for return fixup") | 136 | ERRDEF(XFIXUP, "function too long for return fixup") |
137 | ERRDEF(XPARAM, "<name> or " LUA_QL("...") " expected") | 137 | ERRDEF(XPARAM, "<name> or " LUA_QL("...") " expected") |
138 | #if !LJ_52 | ||
138 | ERRDEF(XAMBIG, "ambiguous syntax (function call x new statement)") | 139 | ERRDEF(XAMBIG, "ambiguous syntax (function call x new statement)") |
140 | #endif | ||
139 | ERRDEF(XFUNARG, "function arguments expected") | 141 | ERRDEF(XFUNARG, "function arguments expected") |
140 | ERRDEF(XSYMBOL, "unexpected symbol") | 142 | ERRDEF(XSYMBOL, "unexpected symbol") |
141 | ERRDEF(XDOTS, "cannot use " LUA_QL("...") " outside a vararg function") | 143 | ERRDEF(XDOTS, "cannot use " LUA_QL("...") " outside a vararg function") |
diff --git a/src/lj_parse.c b/src/lj_parse.c index d0396a59..2bb8c92f 100644 --- a/src/lj_parse.c +++ b/src/lj_parse.c | |||
@@ -1910,8 +1910,10 @@ static void parse_args(LexState *ls, ExpDesc *e) | |||
1910 | BCReg base; | 1910 | BCReg base; |
1911 | BCLine line = ls->linenumber; | 1911 | BCLine line = ls->linenumber; |
1912 | if (ls->token == '(') { | 1912 | if (ls->token == '(') { |
1913 | #if !LJ_52 | ||
1913 | if (line != ls->lastline) | 1914 | if (line != ls->lastline) |
1914 | err_syntax(ls, LJ_ERR_XAMBIG); | 1915 | err_syntax(ls, LJ_ERR_XAMBIG); |
1916 | #endif | ||
1915 | lj_lex_next(ls); | 1917 | lj_lex_next(ls); |
1916 | if (ls->token == ')') { /* f(). */ | 1918 | if (ls->token == ')') { /* f(). */ |
1917 | args.k = VVOID; | 1919 | args.k = VVOID; |