Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initial cut of giving methods and submethods a *%_ unless they alread…
…y have a slurpy hash parameter, to meet Interface Consistency section of S12.
  • Loading branch information
jnthn committed Jun 3, 2009
1 parent 12a6019 commit 05a4a1c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/parser/actions.pm
Expand Up @@ -833,6 +833,17 @@ method method_def($/) {
);
$block[0].unshift(PAST::Var.new( :name('__CANDIDATE_LIST__'), :scope('lexical'), :isdecl(1) ));

# Add *%_ parameter if there's no other named slurpy.
my $need_slurpy_hash := 1;
for @($block[0]) {
if $_.isa(PAST::Var) && $_.scope() eq 'parameter' && $_.named() && $_.slurpy() {
$need_slurpy_hash := 0;
}
}
if $need_slurpy_hash {
$block[0].push(PAST::Var.new( :name('%_'), :scope('parameter'), :named(1), :slurpy(1) ));
}

$block.control(return_handler_past());
block_signature($block);
$block<default_param_type_node>.name('Any');
Expand Down

0 comments on commit 05a4a1c

Please sign in to comment.