Patch 8.2.3370
Problem:    Vim9: no check for white space before type in declaration.
            (Naohiro Ono)
Solution:   Check for white space like in a compiled function. (closes #8785)
Files:      src/eval.c, src/testdir/test_vim9_assign.vim


*** ../vim-8.2.3369/src/eval.c  2021-08-15 13:49:38.126905573 +0200
--- src/eval.c  2021-08-23 22:21:43.374971123 +0200
***************
*** 887,893 ****
            if (*p == ':')
            {
                scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
!               char_u   *tp = skipwhite(p + 1);
  
                // parse the type after the name
                lp->ll_type = parse_type(&tp, &si->sn_type_list, !quiet);
--- 887,899 ----
            if (*p == ':')
            {
                scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
!               char_u       *tp = skipwhite(p + 1);
! 
!               if (tp == p + 1 && !quiet)
!               {
!                   semsg(_(e_white_space_required_after_str_str), ":", p);
!                   return NULL;
!               }
  
                // parse the type after the name
                lp->ll_type = parse_type(&tp, &si->sn_type_list, !quiet);
*** ../vim-8.2.3369/src/testdir/test_vim9_assign.vim    2021-08-11 
21:49:19.630869311 +0200
--- src/testdir/test_vim9_assign.vim    2021-08-23 22:21:09.543003378 +0200
***************
*** 1722,1727 ****
--- 1722,1729 ----
    END
    CheckScriptFailure(lines, 'E1069:')
  
+   CheckDefAndScriptFailure(['var n:number = 42'], 'E1069:')
+ 
    lines =<< trim END
      vim9script
      var name: asdf
*** ../vim-8.2.3369/src/version.c       2021-08-23 21:18:58.270760996 +0200
--- src/version.c       2021-08-23 22:18:11.275133010 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3370,
  /**/

-- 
The Characters and incidents portrayed and the names used are fictitious and
any similarity to the names, characters, or history of any person is entirely
accidental and unintentional.
                                  Signed RICHARD M. NIXON
                 "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/202108232023.17NKNF5G1750665%40masaka.moolenaar.net.

Raspunde prin e-mail lui