Allow package scoped functions to be called without arguments
The parser currently only allows package scoped functions to be called if there is at least one argument. But package scoped functions are the same as normal functions and it is allowed to call them with no arguments. It is even possible to pass no value for a positional argument, if the positional argument has a default value. Update the parser to handle this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
f9aadc13b5
commit
fb8681a376
2
parse.y
2
parse.y
|
|
@ -3723,7 +3723,7 @@ expr_primary
|
|||
delete $3;
|
||||
$$ = tmp;
|
||||
}
|
||||
| PACKAGE_IDENTIFIER K_SCOPE_RES IDENTIFIER '(' expression_list_proper ')'
|
||||
| PACKAGE_IDENTIFIER K_SCOPE_RES IDENTIFIER '(' expression_list_with_nuls ')'
|
||||
{ perm_string use_name = lex_strings.make($3);
|
||||
PECallFunction*tmp = new PECallFunction($1, use_name, *$5);
|
||||
FILE_NAME(tmp, @3);
|
||||
|
|
|
|||
Loading…
Reference in New Issue