Allow named arguments to function instead of only $argv. Philip Ganchev once suggested this, and it was suggested again by Egil Möller.

darcs-hash:20070416200611-ac50b-5eb42c94a65a4e72cae12cd9c04424bdc3b2b4f8.gz
This commit is contained in:
axel
2007-04-17 06:06:11 +10:00
parent a03a4d1ba3
commit 4d6751c274
6 changed files with 122 additions and 29 deletions

6
exec.c
View File

@@ -993,6 +993,8 @@ void exec( job_t *j )
{
const wchar_t * orig_def;
wchar_t * def=0;
array_list_t *named_arguments;
/*
Calls to function_get_definition might need to
@@ -1002,6 +1004,8 @@ void exec( job_t *j )
signal_unblock();
orig_def = function_get_definition( p->argv[0] );
named_arguments = function_get_named_arguments( p->argv[0] );
signal_block();
if( orig_def )
@@ -1019,7 +1023,7 @@ void exec( job_t *j )
current_block->param2.function_call_process = p;
current_block->param1.function_call_name = halloc_register( current_block, wcsdup( p->argv[0] ) );
parse_util_set_argv( p->argv+1 );
parse_util_set_argv( p->argv+1, named_arguments );
parser_forbid_function( p->argv[0] );