Skip to content

Commit

Permalink
Check that all named are after positionals
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek committed Jan 30, 2012
1 parent e485176 commit b13d600
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pmc/callcontext.pmc
Expand Up @@ -1159,6 +1159,8 @@ Caller has to to autoboxing.

GET_ATTR_param(INTERP, SELF, ret);
ret->type = -1; /* Empty for now */
ret->name = NULL;

GET_ATTR_state(INTERP, SELF, state);

if (state == param_finished)
Expand Down Expand Up @@ -1293,6 +1295,11 @@ Caller has to to autoboxing.


case param_named:
if (!(arg_flags & PARROT_ARG_NAME))
Parrot_ex_throw_from_c_args(interp, NULL,
EXCEPTION_INVALID_OPERATION,
"named arguments must follow all positional arguments");

/* We have pair (name, value) in 2 sequential params */
ret->name = is_constant
? Parrot_pcc_get_string_constant(interp, ctx, raw_index)
Expand Down

0 comments on commit b13d600

Please sign in to comment.