Patch 8.2.1719
Problem: Vim9: no error if comma is missing in between arguments.
Solution: Give an error message.
Files: src/errors.h, src/vim9compile.c, src/testdir/test_vim9_expr.vim
*** ../vim-8.2.1718/src/errors.h 2020-09-16 21:41:49.746622621 +0200
--- src/errors.h 2020-09-20 22:38:36.555084187 +0200
***************
*** 268,271 ****
--- 268,273 ----
INIT(= N_("E1121: Cannot change dict item"));
EXTERN char e_variable_is_locked_str[]
INIT(= N_("E1122: Variable is locked: %s"));
+ EXTERN char e_missing_comma_before_argument_str[]
+ INIT(= N_("E1123: Missing comma before argument: %s"));
#endif
*** ../vim-8.2.1718/src/vim9compile.c 2020-09-19 18:19:15.667278827 +0200
--- src/vim9compile.c 2020-09-20 22:39:53.426692167 +0200
***************
*** 2290,2295 ****
--- 2290,2296 ----
{
char_u *p = *arg;
char_u *whitep = *arg;
+ int must_end = FALSE;
for (;;)
{
***************
*** 2300,2305 ****
--- 2301,2311 ----
*arg = p + 1;
return OK;
}
+ if (must_end)
+ {
+ semsg(_(e_missing_comma_before_argument_str), p);
+ return FAIL;
+ }
if (compile_expr0(&p, cctx) == FAIL)
return FAIL;
***************
*** 2316,2321 ****
--- 2322,2329 ----
if (*p != NUL && !VIM_ISWHITE(*p))
semsg(_(e_white_space_required_after_str), ",");
}
+ else
+ must_end = TRUE;
whitep = p;
p = skipwhite(p);
}
*** ../vim-8.2.1718/src/testdir/test_vim9_expr.vim 2020-09-19
14:12:29.178954287 +0200
--- src/testdir/test_vim9_expr.vim 2020-09-20 22:41:31.978190102 +0200
***************
*** 2112,2117 ****
--- 2112,2118 ----
"vim9script",
"let x = substitute ('x', 'x', 'x', 'x')"
], 'E121:', 2)
+ CheckDefFailure(["let Ref = function('len' [1, 2])"], 'E1123:', 1)
let auto_lines =<< trim END
def g:some#func(): string
*** ../vim-8.2.1718/src/version.c 2020-09-20 22:03:54.241490283 +0200
--- src/version.c 2020-09-20 22:43:14.813666728 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1719,
/**/
--
DENNIS: Oh, very nice. King, eh! I expect you've got a palace and fine
clothes and courtiers and plenty of food. And how d'you get that? By
exploiting the workers! By hanging on to outdated imperialist dogma
which perpetuates the social and economic differences in our society!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202009202050.08KKo6i73242686%40masaka.moolenaar.net.