]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.2393: Vim9: error message when script line starts with "[{" v8.2.2393
authorBram Moolenaar <Bram@vim.org>
Fri, 22 Jan 2021 21:06:56 +0000 (22:06 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 22 Jan 2021 21:06:56 +0000 (22:06 +0100)
Problem:    Vim9: error message when script line starts with "[{".
Solution:   Do not give an error for checking for end of list.

src/dict.c
src/testdir/test_vim9_script.vim
src/version.c

index fc8756c57bc32d931aa5b718dcc0cced51cc3618..b267e240db130afccc5d2bd91313dbbcf21a090b 100644 (file)
@@ -1032,7 +1032,8 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
 
     if (**arg != '}')
     {
-       semsg(_(e_missing_dict_end), *arg);
+       if (evalarg != NULL)
+           semsg(_(e_missing_dict_end), *arg);
 failret:
        if (d != NULL)
            dict_free(d);
index 957671c53b03148a4b1bb471cff31c9026f5e807..9dadf1edaa8b22e6a5484a524accdb780a9c7616 100644 (file)
@@ -815,6 +815,12 @@ def Test_list_vimscript()
       # comment 6
   END
   assert_equal(['# comment 1', 'two', '# comment 3', '', 'five', '# comment 6'], lines)
+
+  lines =<< trim END
+    [{
+      a: 0}]->string()->assert_equal("[{'a': 0}]")
+  END
+  CheckDefAndScriptSuccess(lines)
 enddef
 
 if has('channel')
index c5fdf85855733a9ec7aaf4db1edf0516b08f3355..02fd3fa49f11cc8afe86d0e30a8c083e9d2c815b 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2393,
 /**/
     2392,
 /**/