Author: jonathan
Date: Wed Jan  7 14:15:48 2009
New Revision: 35177

Modified:
   branches/rvar2/languages/perl6/src/parser/actions.pm

Log:
[rakudo] Earlier speculation that we may always want to make things with a ! 
twigil have attribute scope turned out to be right: we need to do this so we 
can handle attributes declared in roles (at least, until we get to the point 
where we can have the roles available at compile time for introspection).

Modified: branches/rvar2/languages/perl6/src/parser/actions.pm
==============================================================================
--- branches/rvar2/languages/perl6/src/parser/actions.pm        (original)
+++ branches/rvar2/languages/perl6/src/parser/actions.pm        Wed Jan  7 
14:15:48 2009
@@ -1650,6 +1650,11 @@
             if $sym && $sym<scope> { $var.scope( $sym<scope> ); }
         }
 
+        # The ! twigil always implies attribute scope.
+        if $twigil eq '!' {
+            $var.scope('attribute');
+        }
+
         # ! and . twigils may need 'self' for attribute lookup ...
         if $twigil eq '!' || $twigil eq '.' {
             $var.unshift( PAST::Var.new( :name('self'), :scope('lexical') ) );

Reply via email to