From 6c7e546a99754eef6ff90bf9c26900da1a91c626 Mon Sep 17 00:00:00 2001 From: jnthn Date: Mon, 29 Jun 2009 11:04:42 +0200 Subject: [PATCH] The implicit *%_ for methods should be in the Signature object too. Plus a little code re-ordering so the signature is set up early enough for us to do this. --- src/parser/actions.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/parser/actions.pm b/src/parser/actions.pm index 3e08eb8abdd..a36f7d419d4 100644 --- a/src/parser/actions.pm +++ b/src/parser/actions.pm @@ -838,6 +838,10 @@ method method_def($/) { $block.name( $name ); } + $block.control(return_handler_past()); + block_signature($block); + $block.name('Any'); + # Add lexical 'self' and a slot for the candidate dispatcher list. $block[0].unshift( PAST::Var.new( :name('self'), :scope('lexical'), :isdecl(1), @@ -855,11 +859,16 @@ method method_def($/) { } if $need_slurpy_hash { $block[0].push(PAST::Var.new( :name('%_'), :scope('parameter'), :named(1), :slurpy(1) )); + $block.loadinit().push(PAST::Op.new( + :pasttype('callmethod'), + :name('!add_param'), + PAST::Var.new( :name('signature'), :scope('register') ), + PAST::Val.new( :value('%_') ), + PAST::Val.new( :value(1), :named('named') ), + PAST::Val.new( :value(1), :named('slurpy') ) + )); } - $block.control(return_handler_past()); - block_signature($block); - $block.name('Any'); # Ensure there's an invocant in the signature. $block.loadinit().push(PAST::Op.new( :pasttype('callmethod'),