aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2012-09-28 18:12:43 +0200
committerMike Pall <mike>2012-09-28 18:12:43 +0200
commit550ac44e41ad430f8a355533bf03cf04b61bb266 (patch)
tree86f244ef8d9962be173af4c698b1245f22b1ee34 /src
parent7a6bb9a20836107cd715a818072cbbd1c8eac516 (diff)
downloadluajit-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.h2
-rw-r--r--src/lj_parse.c2
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")
135ERRDEF(XMATCH, LUA_QS " expected (to close " LUA_QS " at line %d)") 135ERRDEF(XMATCH, LUA_QS " expected (to close " LUA_QS " at line %d)")
136ERRDEF(XFIXUP, "function too long for return fixup") 136ERRDEF(XFIXUP, "function too long for return fixup")
137ERRDEF(XPARAM, "<name> or " LUA_QL("...") " expected") 137ERRDEF(XPARAM, "<name> or " LUA_QL("...") " expected")
138#if !LJ_52
138ERRDEF(XAMBIG, "ambiguous syntax (function call x new statement)") 139ERRDEF(XAMBIG, "ambiguous syntax (function call x new statement)")
140#endif
139ERRDEF(XFUNARG, "function arguments expected") 141ERRDEF(XFUNARG, "function arguments expected")
140ERRDEF(XSYMBOL, "unexpected symbol") 142ERRDEF(XSYMBOL, "unexpected symbol")
141ERRDEF(XDOTS, "cannot use " LUA_QL("...") " outside a vararg function") 143ERRDEF(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;