Patch 8.2.1429
Problem:    Vim9: no error for missing white after : in dict.
Solution:   Check for white space. (closes #6671)  Also check that there is no
            white before the :.
Files:      src/vim9compile.c, src/testdir/test_vim9_expr.vim,
            src/testdir/test_vim9_func.vim


*** ../vim-8.2.1428/src/vim9compile.c   2020-08-12 15:48:51.658129308 +0200
--- src/vim9compile.c   2020-08-12 17:32:22.668181763 +0200
***************
*** 2593,2606 ****
            }
        }
  
-       *arg = skipwhite(*arg);
        if (**arg != ':')
        {
!           semsg(_(e_missing_dict_colon), *arg);
            return FAIL;
        }
- 
        whitep = *arg + 1;
        *arg = skipwhite(*arg + 1);
        if (may_get_next_line(whitep, arg, cctx) == FAIL)
        {
--- 2593,2613 ----
            }
        }
  
        if (**arg != ':')
        {
!           if (*skipwhite(*arg) == ':')
!               semsg(_(e_no_white_before), ":");
!           else
!               semsg(_(e_missing_dict_colon), *arg);
            return FAIL;
        }
        whitep = *arg + 1;
+       if (!IS_WHITE_OR_NUL(*whitep))
+       {
+           semsg(_(e_white_after), ":");
+           return FAIL;
+       }
+ 
        *arg = skipwhite(*arg + 1);
        if (may_get_next_line(whitep, arg, cctx) == FAIL)
        {
*** ../vim-8.2.1428/src/testdir/test_vim9_expr.vim      2020-08-12 
15:21:18.970700474 +0200
--- src/testdir/test_vim9_expr.vim      2020-08-12 17:34:23.423557406 +0200
***************
*** 1494,1499 ****
--- 1494,1503 ----
    mixed = #{a: 234}
    mixed = #{}
  
+   call CheckDefFailure(["let x = #{a:8}"], 'E1069:')
+   call CheckDefFailure(["let x = #{a : 8}"], 'E1068:')
+   call CheckDefFailure(["let x = #{a :8}"], 'E1068:')
+ 
    call CheckDefFailure(["let x = #{8: 8}"], 'E1014:')
    call CheckDefFailure(["let x = #{xxx}"], 'E720:')
    call CheckDefFailure(["let x = #{xxx: 1", "let y = 2"], 'E722:')
*** ../vim-8.2.1428/src/testdir/test_vim9_func.vim      2020-08-12 
14:21:06.263590410 +0200
--- src/testdir/test_vim9_func.vim      2020-08-12 17:35:07.019332614 +0200
***************
*** 774,780 ****
      enddef
  
      def RetListAny(): list<any>
!       return items({'k' : 'v'})
      enddef
  
      def RetListString(): list<string>
--- 774,780 ----
      enddef
  
      def RetListAny(): list<any>
!       return items({'k': 'v'})
      enddef
  
      def RetListString(): list<string>
*** ../vim-8.2.1428/src/version.c       2020-08-12 16:38:07.267186093 +0200
--- src/version.c       2020-08-12 17:35:49.695112811 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1429,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
180. You maintain more than six e-mail addresses.

 /// 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/202008121536.07CFaYfd080203%40masaka.moolenaar.net.

Raspunde prin e-mail lui