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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user