1
0
forked from aniani/vim

patch 9.0.0230: no error for comma missing in list in :def function

Problem:    No error for comma missing in list in :def function.
Solution:   Check for missing comma. (closes #10943)
This commit is contained in:
Bram Moolenaar
2022-08-20 14:51:17 +01:00
parent 62e0e2e54b
commit 2984ed31d9
7 changed files with 26 additions and 15 deletions

View File

@@ -975,6 +975,7 @@ compile_list(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
int count = 0;
int is_const;
int is_all_const = TRUE; // reset when non-const encountered
int must_end = FALSE;
for (;;)
{
@@ -993,6 +994,11 @@ compile_list(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
++p;
break;
}
if (must_end)
{
semsg(_(e_missing_comma_in_list_str), p);
return FAIL;
}
if (compile_expr0_ext(&p, cctx, &is_const) == FAIL)
return FAIL;
if (!is_const)
@@ -1007,6 +1013,8 @@ compile_list(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
return FAIL;
}
}
else
must_end = TRUE;
whitep = p;
p = skipwhite(p);
}