浏览代码

From Lua 5.2: Remove error for ambiguous function call syntax.

Needs -DLUAJIT_ENABLE_LUA52COMPAT.
Mike Pall 13 年之前
父节点
当前提交
550ac44e41
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 2 0
      src/lj_errmsg.h
  2. 2 0
      src/lj_parse.c

+ 2 - 0
src/lj_errmsg.h

@@ -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")

+ 2 - 0
src/lj_parse.c

@@ -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;