develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35177 - branches/rvar2/languages/perl6/src/parser

From:
jonathan
Date:
January 7, 2009 14:15
Subject:
[svn:parrot] r35177 - branches/rvar2/languages/perl6/src/parser
Message ID:
20090107221549.2D410CB9F9@x12.develooper.com
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') ) );



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About