]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
From Lua 5.2: Remove error for ambiguous function call syntax.
authorMike Pall <mike>
Fri, 28 Sep 2012 16:12:43 +0000 (18:12 +0200)
committerMike Pall <mike>
Fri, 28 Sep 2012 16:12:43 +0000 (18:12 +0200)
Needs -DLUAJIT_ENABLE_LUA52COMPAT.

src/lj_errmsg.h
src/lj_parse.c

index f368da5a20516377e9375fd64c516b5ae18ea1f1..7097f5e3a93f627e38a1729304f09d69a6446947 100644 (file)
@@ -135,7 +135,9 @@ ERRDEF(XLIMF,       "function at line %d has more than %d %s")
 ERRDEF(XMATCH, LUA_QS " expected (to close " LUA_QS " at line %d)")
 ERRDEF(XFIXUP, "function too long for return fixup")
 ERRDEF(XPARAM, "<name> or " LUA_QL("...") " expected")
+#if !LJ_52
 ERRDEF(XAMBIG, "ambiguous syntax (function call x new statement)")
+#endif
 ERRDEF(XFUNARG,        "function arguments expected")
 ERRDEF(XSYMBOL,        "unexpected symbol")
 ERRDEF(XDOTS,  "cannot use " LUA_QL("...") " outside a vararg function")
index d0396a5951b8f1b6869019b1939a08e1596243e5..2bb8c92f62cdbdbcffcfe07721937da1f135784e 100644 (file)
@@ -1910,8 +1910,10 @@ static void parse_args(LexState *ls, ExpDesc *e)
   BCReg base;
   BCLine line = ls->linenumber;
   if (ls->token == '(') {
+#if !LJ_52
     if (line != ls->lastline)
       err_syntax(ls, LJ_ERR_XAMBIG);
+#endif
     lj_lex_next(ls);
     if (ls->token == ')') {  /* f(). */
       args.k = VVOID;