forked from aniani/vim
patch 8.2.2745: Vim9: missing part of the argument change
Problem: Vim9: missing part of the argument change. Solution: Add missing changes.
This commit is contained in:
parent
962c43bf0d
commit
51e7e78de7
@ -55,7 +55,7 @@ func_tbl_get(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Get one function argument.
|
* Get one function argument.
|
||||||
* If "argtypes" is not NULL also get the type: "arg: type".
|
* If "argtypes" is not NULL also get the type: "arg: type" (:def function).
|
||||||
* If "types_optional" is TRUE a missing type is OK, use "any".
|
* If "types_optional" is TRUE a missing type is OK, use "any".
|
||||||
* If "evalarg" is not NULL use it to check for an already declared name.
|
* If "evalarg" is not NULL use it to check for an already declared name.
|
||||||
* Return a pointer to after the type.
|
* Return a pointer to after the type.
|
||||||
@ -73,6 +73,7 @@ one_function_arg(
|
|||||||
{
|
{
|
||||||
char_u *p = arg;
|
char_u *p = arg;
|
||||||
char_u *arg_copy = NULL;
|
char_u *arg_copy = NULL;
|
||||||
|
int is_underscore = FALSE;
|
||||||
|
|
||||||
while (ASCII_ISALNUM(*p) || *p == '_')
|
while (ASCII_ISALNUM(*p) || *p == '_')
|
||||||
++p;
|
++p;
|
||||||
@ -107,7 +108,8 @@ one_function_arg(
|
|||||||
*p = c;
|
*p = c;
|
||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
is_underscore = arg_copy[0] == '_' && arg_copy[1] == NUL;
|
||||||
|
if (argtypes != NULL && !is_underscore)
|
||||||
// Check for duplicate argument name.
|
// Check for duplicate argument name.
|
||||||
for (i = 0; i < newargs->ga_len; ++i)
|
for (i = 0; i < newargs->ga_len; ++i)
|
||||||
if (STRCMP(((char_u **)(newargs->ga_data))[i], arg_copy) == 0)
|
if (STRCMP(((char_u **)(newargs->ga_data))[i], arg_copy) == 0)
|
||||||
@ -146,7 +148,7 @@ one_function_arg(
|
|||||||
if (!skip)
|
if (!skip)
|
||||||
type = vim_strnsave(type, p - type);
|
type = vim_strnsave(type, p - type);
|
||||||
}
|
}
|
||||||
else if (*skipwhite(p) != '=' && !types_optional)
|
else if (*skipwhite(p) != '=' && !types_optional && !is_underscore)
|
||||||
{
|
{
|
||||||
semsg(_(e_missing_argument_type_for_str),
|
semsg(_(e_missing_argument_type_for_str),
|
||||||
arg_copy == NULL ? arg : arg_copy);
|
arg_copy == NULL ? arg : arg_copy);
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2745,
|
||||||
/**/
|
/**/
|
||||||
2744,
|
2744,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user