changeset 26330:55e658312376 v8.2.3696

patch 8.2.3696: Vim9: error for invalid assignment when skipping Commit: https://github.com/vim/vim/commit/7f2c34166402740a661131d6341bbf874bdb3d48 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 29 16:01:49 2021 +0000 patch 8.2.3696: Vim9: error for invalid assignment when skipping Problem: Vim9: error for invalid assignment when skipping. Solution: Do not check white space when skipping. (closes https://github.com/vim/vim/issues/9243)
author Bram Moolenaar <Bram@vim.org>
date Mon, 29 Nov 2021 17:15:04 +0100
parents 8afd7aa25ab6
children 6dd0e218c74e
files src/evalvars.c src/testdir/test_vim9_assign.vim src/version.c
diffstat 3 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -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);
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -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]',
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3696,
+/**/
     3695,
 /**/
     3694,