Author: jonathan
Date: Thu Aug 7 04:24:14 2008
New Revision: 30087
Modified:
trunk/languages/perl6/src/parser/actions.pm
Log:
[rakudo] Make use of attribute variables ($!foo) work in nested scopes, not
just in the main method body itself.
Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm (original)
+++ trunk/languages/perl6/src/parser/actions.pm Thu Aug 7 04:24:14 2008
@@ -2218,9 +2218,13 @@
$past.scope('package');
}
- # If it has a ! twigil, give it attribute scope.
+ # If it has a ! twigil, give it attribute scope and add self.
if $twigil eq '!' {
$past.scope('attribute');
+ $past.unshift(PAST::Var.new(
+ :name('self'),
+ :scope('lexical')
+ ));
}
# If we have something with an & sigil see if it has any entries