0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2744: Vim9: no way to explicitly ignore an argument

Problem:    Vim9: no way to explicitly ignore an argument.
Solution:   Use the underscore as the name for an ignored argument.
This commit is contained in:
Bram Moolenaar
2021-04-10 17:18:09 +02:00
parent 599410cb3c
commit 962c43bf0d
7 changed files with 86 additions and 5 deletions

View File

@@ -3514,7 +3514,12 @@ eval7(
{
int flags = evalarg == NULL ? 0 : evalarg->eval_flags;
if ((in_vim9script() ? **arg : *skipwhite(*arg)) == '(')
if (in_vim9script() && len == 1 && *s == '_')
{
emsg(_(e_cannot_use_underscore_here));
ret = FAIL;
}
else if ((in_vim9script() ? **arg : *skipwhite(*arg)) == '(')
{
// "name(..." recursive!
*arg = skipwhite(*arg);