0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1182: Vim9: no check for whitespace after comma in lambda

Problem:    Vim9: no check for whitespace after comma in lambda.
Solution:   Give error if white space is missing.
This commit is contained in:
Bram Moolenaar
2020-07-11 15:20:48 +02:00
parent 21e5bdd271
commit 914e7eaa67
4 changed files with 16 additions and 3 deletions

View File

@@ -266,10 +266,20 @@ get_function_args(
else if (any_default)
{
emsg(_("E989: Non-default argument follows default argument"));
mustend = TRUE;
goto err_ret;
}
if (*p == ',')
{
++p;
// Don't give this error when skipping, it makes the "->" not
// found in "{k,v -> x}" and give a confusing error.
if (!skip && in_vim9script()
&& !IS_WHITE_OR_NUL(*p) && *p != endchar)
{
semsg(_(e_white_after), ",");
goto err_ret;
}
}
else
mustend = TRUE;
}