Problem: Confusing error message with white space before comma in the
arguments of a function declaration.
Solution: Give a specific error message. (closes #2235)
CheckScriptFailure(['def Func5(items)', 'echo "a"'], 'E1077:')
enddef
+def Test_white_space_before_comma()
+ var lines =<< trim END
+ vim9script
+ def Func(a: number , b: number)
+ enddef
+ END
+ CheckScriptFailure(lines, 'E1068:')
+enddef
+
def Test_white_space_after_comma()
var lines =<< trim END
vim9script
emsg(_("E989: Non-default argument follows default argument"));
goto err_ret;
}
+
+ if (VIM_ISWHITE(*p) && *skipwhite(p) == ',')
+ {
+ // Be tolerant when skipping
+ if (!skip)
+ {
+ semsg(_(e_no_white_space_allowed_before_str_str), ",", p);
+ goto err_ret;
+ }
+ p = skipwhite(p);
+ }
if (*p == ',')
{
++p;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2726,
/**/
2725,
/**/