0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

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 #9243)
This commit is contained in:
Bram Moolenaar
2021-11-29 16:01:49 +00:00
parent 5c1ec439f0
commit 7f2c341664
3 changed files with 9 additions and 1 deletions

View 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);

View 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]',

View File

@@ -757,6 +757,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3696,
/**/
3695,
/**/