Patch 8.2.4055
Problem:    Vim9: line break in expression causes v:errmsg to be filled.
            (Yegappan Lakshmanan)
Solution:   Do not give an error when skipping over an expression.
Files:      src/userfunc.c, src/testdir/test_vim9_expr.vim


*** ../vim-8.2.4054/src/userfunc.c      2022-01-10 18:06:58.686381782 +0000
--- src/userfunc.c      2022-01-10 18:30:48.129206733 +0000
***************
*** 1703,1708 ****
--- 1703,1710 ----
      typval_T  argvars[MAX_FUNC_ARGS + 1];     // vars for arguments
      int               argcount = 0;           // number of arguments found
      int               vim9script = in_vim9script();
+     int               evaluate = evalarg == NULL
+                              ? FALSE : (evalarg->eval_flags & EVAL_EVALUATE);
  
      /*
       * Get the arguments.
***************
*** 1728,1734 ****
        {
            if (*argp != ',' && *skipwhite(argp) == ',')
            {
!               semsg(_(e_no_white_space_allowed_before_str_str), ",", argp);
                ret = FAIL;
                break;
            }
--- 1730,1738 ----
        {
            if (*argp != ',' && *skipwhite(argp) == ',')
            {
!               if (evaluate)
!                   semsg(_(e_no_white_space_allowed_before_str_str),
!                                                                   ",", argp);
                ret = FAIL;
                break;
            }
***************
*** 1739,1745 ****
            break;
        if (vim9script && !IS_WHITE_OR_NUL(argp[1]))
        {
!           semsg(_(e_white_space_required_after_str_str), ",", argp);
            ret = FAIL;
            break;
        }
--- 1743,1750 ----
            break;
        if (vim9script && !IS_WHITE_OR_NUL(argp[1]))
        {
!           if (evaluate)
!               semsg(_(e_white_space_required_after_str_str), ",", argp);
            ret = FAIL;
            break;
        }
***************
*** 1778,1784 ****
  
        funcargs.ga_len -= i;
      }
!     else if (!aborting())
      {
        if (argcount == MAX_FUNC_ARGS)
            emsg_funcname(e_too_many_arguments_for_function_str_2, name);
--- 1783,1789 ----
  
        funcargs.ga_len -= i;
      }
!     else if (!aborting() && evaluate)
      {
        if (argcount == MAX_FUNC_ARGS)
            emsg_funcname(e_too_many_arguments_for_function_str_2, name);
*** ../vim-8.2.4054/src/testdir/test_vim9_expr.vim      2022-01-09 
13:36:20.351866599 +0000
--- src/testdir/test_vim9_expr.vim      2022-01-10 18:32:15.525167858 +0000
***************
*** 3147,3152 ****
--- 3147,3168 ----
    CheckDefExecFailure(lines, 'E1013:')
  enddef
  
+ def Test_expr7_method_call_linebreak()
+   # this was giving an error when skipping over the expression
+   var lines =<< trim END
+       vim9script
+       def Test()
+         var a: dict<any> = {b: {}}
+         a.b->extend({f1: 1,
+                          f2: 2})
+         echo a
+       enddef
+       defcompile
+       assert_equal('', v:errmsg)
+   END
+   CheckScriptSuccess(lines)
+ enddef
+ 
  
  def Test_expr7_not()
    var lines =<< trim END
*** ../vim-8.2.4054/src/version.c       2022-01-10 18:42:48.776314411 +0000
--- src/version.c       2022-01-10 18:49:26.859519232 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4055,
  /**/

-- 
ARTHUR: Right! Knights! Forward!
   ARTHUR leads a charge toward the castle.  Various shots of them battling on,
   despite being hit by a variety of farm animals.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220110185134.449B81C04D4%40moolenaar.net.

Raspunde prin e-mail lui