]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.1159: Vim9: no error for missing space after a comma v8.2.1159
authorBram Moolenaar <Bram@vim.org>
Wed, 8 Jul 2020 16:38:08 +0000 (18:38 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 8 Jul 2020 16:38:08 +0000 (18:38 +0200)
Problem:    Vim9: no error for missing space after a comma.
Solution:   Check for white space.

src/testdir/test_vim9_expr.vim
src/testdir/test_vim9_script.vim
src/version.c
src/vim9compile.c

index dd2a8ade51919c6b59db4f8aa5574f8c022c363d..b4e060494307d320741495d631dea18b535e1b31 100644 (file)
@@ -1014,6 +1014,7 @@ def Test_expr7_list()
 
   call CheckDefExecFailure(["let x = g:anint[3]"], 'E714:')
   call CheckDefFailure(["let x = g:list_mixed[xxx]"], 'E1001:')
+  call CheckDefFailure(["let x = [1,2,3]"], 'E1069:')
   call CheckDefExecFailure(["let x = g:list_mixed['xx']"], 'E39:')
   call CheckDefFailure(["let x = g:list_mixed[0"], 'E111:')
   call CheckDefExecFailure(["let x = g:list_empty[3]"], 'E684:')
index a95761fc0843feba9e460c383e57c30cbe0a9269..f923e14661e2ba344dceb44fb4afe48fe0e772fc 100644 (file)
@@ -571,7 +571,7 @@ enddef
 
 def Test_try_catch_fails()
   call CheckDefFailure(['catch'], 'E603:')
-  call CheckDefFailure(['try', 'echo 0', 'catch','catch'], 'E1033:')
+  call CheckDefFailure(['try', 'echo 0', 'catch', 'catch'], 'E1033:')
   call CheckDefFailure(['try', 'echo 0', 'catch /pat'], 'E1067:')
   call CheckDefFailure(['finally'], 'E606:')
   call CheckDefFailure(['try', 'echo 0', 'finally', 'echo 1', 'finally'], 'E607:')
index 587f299338a3c87ba0ecf011aef1477778038963..1af0262cc77d2da990df031e8ea2e84db412b98b 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1159,
 /**/
     1158,
 /**/
index 07aacb37c07d456af7896f5649d1780b3fbc8560..0aae8f2138aed82f0d7b8cf8f44f8b9031294183 100644 (file)
@@ -3060,7 +3060,14 @@ compile_list(char_u **arg, cctx_T *cctx)
            break;
        ++count;
        if (*p == ',')
+       {
            ++p;
+           if (*p != ']' && !IS_WHITE_OR_NUL(*p))
+           {
+               semsg(_(e_white_after), ",");
+               return FAIL;
+           }
+       }
        whitep = p;
        p = skipwhite(p);
     }