Author: jonathan
Date: Wed Nov 26 11:09:59 2008
New Revision: 33231
Modified:
trunk/languages/perl6/src/parser/actions.pm
Log:
[rakudo] Bug fix for subs that take parameters with the & sigil; we need to
register the symbol after we stripped.
Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm (original)
+++ trunk/languages/perl6/src/parser/actions.pm Wed Nov 26 11:09:59 2008
@@ -1055,15 +1055,15 @@
# Add parameter declaration to the block, if we're producing one.
unless $?SIG_BLOCK_NOT_NEEDED {
- # Register symbol and put parameter PAST into the node.
- $block_past.symbol($parameter.name(), :scope('lexical'));
- $params.push($parameter);
-
# If it has & sigil, strip it off.
if substr($parameter.name(), 0, 1) eq '&' {
$parameter.name(substr($parameter.name(), 1));
}
+ # Register symbol and put parameter PAST into the node.
+ $block_past.symbol($parameter.name(), :scope('lexical'));
+ $params.push($parameter);
+
# If it is invocant, modify it to be just a lexical and bind self
to it.
if substr($separator, 0, 1) eq ':' {
$is_invocant := 1;