Patch 8.2.1367
Problem:    Vim9: no error for missing white space around operator.
Solution:   Check for white space around *, / and %.
Files:      src/eval.c, src/testdir/test_vim9_expr.vim


*** ../vim-8.2.1366/src/eval.c  2020-08-05 10:53:15.087273357 +0200
--- src/eval.c  2020-08-05 11:32:17.712437948 +0200
***************
*** 2586,2598 ****
            break;
  
        evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
        if (getnext)
            *arg = eval_next_line(evalarg);
        else
        {
            if (evaluate && in_vim9script() && !VIM_ISWHITE(**arg))
            {
!               error_white_both(p, 1);
                clear_tv(rettv);
                return FAIL;
            }
--- 2586,2599 ----
            break;
  
        evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
+       oplen = (concat && p[1] == '.') ? 2 : 1;
        if (getnext)
            *arg = eval_next_line(evalarg);
        else
        {
            if (evaluate && in_vim9script() && !VIM_ISWHITE(**arg))
            {
!               error_white_both(p, oplen);
                clear_tv(rettv);
                return FAIL;
            }
***************
*** 2622,2628 ****
        /*
         * Get the second variable.
         */
-       oplen = (op == '.' && *(*arg + 1) == '.') ? 2 : 1;
        if (evaluate && in_vim9script() && !IS_WHITE_OR_NUL((*arg)[oplen]))
        {
            error_white_both(p, oplen);
--- 2623,2628 ----
***************
*** 2796,2812 ****
        if (op != '*' && op != '/' && op != '%')
            break;
  
        if (getnext)
            *arg = eval_next_line(evalarg);
        else
            *arg = p;
  
  #ifdef FEAT_FLOAT
        f1 = 0;
        f2 = 0;
  #endif
        error = FALSE;
-       evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
        if (evaluate)
        {
  #ifdef FEAT_FLOAT
--- 2796,2820 ----
        if (op != '*' && op != '/' && op != '%')
            break;
  
+       evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
        if (getnext)
            *arg = eval_next_line(evalarg);
        else
+       {
+           if (evaluate && in_vim9script() && !VIM_ISWHITE(**arg))
+           {
+               error_white_both(p, 1);
+               clear_tv(rettv);
+               return FAIL;
+           }
            *arg = p;
+       }
  
  #ifdef FEAT_FLOAT
        f1 = 0;
        f2 = 0;
  #endif
        error = FALSE;
        if (evaluate)
        {
  #ifdef FEAT_FLOAT
***************
*** 2829,2835 ****
        /*
         * Get the second variable.
         */
!       *arg = skipwhite(*arg + 1);
        if (eval7(arg, &var2, evalarg, FALSE) == FAIL)
            return FAIL;
  
--- 2837,2849 ----
        /*
         * Get the second variable.
         */
!       if (evaluate && in_vim9script() && !IS_WHITE_OR_NUL((*arg)[1]))
!       {
!           error_white_both(p, 1);
!           clear_tv(rettv);
!           return FAIL;
!       }
!       *arg = skipwhite_and_linebreak(*arg + 1, evalarg);
        if (eval7(arg, &var2, evalarg, FALSE) == FAIL)
            return FAIL;
  
*** ../vim-8.2.1366/src/testdir/test_vim9_expr.vim      2020-08-05 
10:53:15.087273357 +0200
--- src/testdir/test_vim9_expr.vim      2020-08-05 11:36:10.635754481 +0200
***************
*** 843,848 ****
--- 843,857 ----
  
    lines =<< trim END
        vim9script
+       let var = 11 +
+                 77 -
+                 22
+       assert_equal(66, var)
+   END
+   CheckScriptSuccess(lines)
+ 
+   lines =<< trim END
+       vim9script
        let var = 'one'
                        .. 'two'
        assert_equal('onetwo', var)
***************
*** 999,1005 ****
  enddef
  
  def Test_expr6_vim9script()
!   # only checks line continuation
    let lines =<< trim END
        vim9script
        let var = 11
--- 1008,1014 ----
  enddef
  
  def Test_expr6_vim9script()
!   # check line continuation
    let lines =<< trim END
        vim9script
        let var = 11
***************
*** 1016,1021 ****
--- 1025,1056 ----
        assert_equal(5, var)
    END
    CheckScriptSuccess(lines)
+ 
+   lines =<< trim END
+       vim9script
+       let var = 11 *
+                       22 /
+               3
+       assert_equal(80, var)
+   END
+   CheckScriptSuccess(lines)
+ 
+   # check white space
+   lines =<< trim END
+       vim9script
+       echo 5*6
+   END
+   CheckScriptFailure(lines, 'E1004:')
+   lines =<< trim END
+       vim9script
+       echo 5 *6
+   END
+   CheckScriptFailure(lines, 'E1004:')
+   lines =<< trim END
+       vim9script
+       echo 5* 6
+   END
+   CheckScriptFailure(lines, 'E1004:')
  enddef
  
  def Test_expr6_float()
*** ../vim-8.2.1366/src/version.c       2020-08-05 11:20:45.178462605 +0200
--- src/version.c       2020-08-05 11:33:05.988296294 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1367,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
125. You begin to wonder how often it REALLY is necessary to get up
     and shower or bathe.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202008050937.0759bIEL3247808%40masaka.moolenaar.net.

Raspunde prin e-mail lui