]> granicus.if.org Git - vim/commitdiff
patch 8.2.1418: Vim9: invalid error for missing white space v8.2.1418
authorBram Moolenaar <Bram@vim.org>
Mon, 10 Aug 2020 20:40:56 +0000 (22:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 10 Aug 2020 20:40:56 +0000 (22:40 +0200)
Problem:    Vim9: invalid error for missing white space after function.
Solution:   Do not skip over white space. (closes #6679)

src/testdir/test_vim9_expr.vim
src/userfunc.c
src/version.c

index d2d2e0b1ebfa4b04f2c035a6de567a3fcaf15efd..f831b5abe5cedc0993ab7bed7cc2ebaf5540bfc0 100644 (file)
@@ -706,7 +706,7 @@ def RetVoid()
   let x = 1
 enddef
 
-def Test_expr4_vimscript()
+def Test_expr4_vim9script()
   # check line continuation
   let lines =<< trim END
       vim9script
@@ -819,6 +819,12 @@ def Test_expr4_vimscript()
     echo 2!= 3
   END
   CheckScriptFailure(lines, 'E1004:')
+
+  lines =<< trim END
+    vim9script
+    echo len('xxx') == 3
+  END
+  CheckScriptSuccess(lines)
 enddef
 
 func Test_expr4_fails()
index 7d3039a45952292651f60c20069737010d08802e..f38c978f4ef982a29e2492df08643038cb2a7002 100644 (file)
@@ -686,7 +686,10 @@ get_func_tv(
     while (--argcount >= 0)
        clear_tv(&argvars[argcount]);
 
-    *arg = skipwhite(argp);
+    if (in_vim9script())
+       *arg = argp;
+    else
+       *arg = skipwhite(argp);
     return ret;
 }
 
@@ -4097,6 +4100,7 @@ ex_call(exarg_T *eap)
     if (!failed || eap->cstack->cs_trylevel > 0)
     {
        // Check for trailing illegal characters and a following command.
+       arg = skipwhite(arg);
        if (!ends_excmd2(eap->arg, arg))
        {
            if (!failed)
index 662a17cfa6216421818ceadf07ad0f7c5e4eb435..bfd5070c4bf31e9326e227848ea3d2edc4c1a467 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1418,
 /**/
     1417,
 /**/