diff src/vim9compile.c @ 19437:5d34ae66118e v8.2.0276

patch 8.2.0276: Vim9: not allowing space before ")" in function call Commit: https://github.com/vim/vim/commit/38a5f517a70d7b76361152d2898d7f826c5b2491 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 19 12:40:39 2020 +0100 patch 8.2.0276: Vim9: not allowing space before ")" in function call Problem: Vim9: not allowing space before ")" in function call is too restrictive. (Ben Jackson) Solution: Skip space before the ")". Adjust other space checks.
author Bram Moolenaar <Bram@vim.org>
date Wed, 19 Feb 2020 12:45:04 +0100
parents f3e8e74cb747
children b26e96f7c12f
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1658,9 +1658,21 @@ compile_arguments(char_u **arg, cctx_T *
 	if (compile_expr1(&p, cctx) == FAIL)
 	    return FAIL;
 	++*argcount;
+
+	if (*p != ',' && *skipwhite(p) == ',')
+	{
+	    emsg(_("E1068: No white space allowed before ,"));
+	    p = skipwhite(p);
+	}
 	if (*p == ',')
-	    p = skipwhite(p + 1);
+	{
+	    ++p;
+	    if (!VIM_ISWHITE(*p))
+		emsg(_("E1069: white space required after ,"));
+	}
+	p = skipwhite(p);
     }
+    p = skipwhite(p);
     if (*p != ')')
     {
 	emsg(_(e_missing_close));