]> granicus.if.org Git - vim/commitdiff
patch 8.2.3696: Vim9: error for invalid assignment when skipping v8.2.3696
authorBram Moolenaar <Bram@vim.org>
Mon, 29 Nov 2021 16:01:49 +0000 (16:01 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 29 Nov 2021 16:01:49 +0000 (16:01 +0000)
Problem:    Vim9: error for invalid assignment when skipping.
Solution:   Do not check white space when skipping. (closes #9243)

src/evalvars.c
src/testdir/test_vim9_assign.vim
src/version.c

index 9124848c0026184c70655e9c052c2939e0c7b184..4342100312788c9bbb76a9614835895df9d70b6f 100644 (file)
@@ -881,7 +881,7 @@ ex_let(exarg_T *eap)
            else
                ++expr;
 
-           if (vim9script && (!VIM_ISWHITE(*argend)
+           if (vim9script && !eap->skip && (!VIM_ISWHITE(*argend)
                                                   || !IS_WHITE_OR_NUL(*expr)))
            {
                vim_strncpy(op, expr - len, len);
index df8f486f9a0f33ed47dd8163fba7f583a1483c0f..394dfe663832cf2269fe6010f430b1f2900bd5a0 100644 (file)
@@ -1854,6 +1854,12 @@ def Test_unlet()
     'var ll = [1, 2]',
     'unlet ll[0: 1]',
     ], 'E1004:', 2)
+  # command recognized as assignment when skipping, should not give an error
+  CheckScriptSuccess([
+    'vim9script',
+    'for i in []',
+    "  put =''",
+    'endfor'])
 
   CheckDefFailure([
     'var ll = [1, 2]',
index e4c85892f21a2c31ef5974c567ffef2c67ef094c..954ea5b4f380089107ed09f3639306a4348690ce 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3696,
 /**/
     3695,
 /**/