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.
diff --git a/src/userfunc.c b/src/userfunc.c
index 2f253c9..b5b57ec 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -266,10 +266,20 @@
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;
}