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

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

From:
pmichaud
Date:
January 8, 2009 22:12
Subject:
[svn:parrot] r35245 - branches/rvar2/languages/perl6/src/parser
Message ID:
20090109061209.A8697CB9F9@x12.develooper.com
Author: pmichaud
Date: Thu Jan  8 22:12:08 2009
New Revision: 35245

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

Log:
[rakudo]: ::Typename is declarational only in a declarational context.


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	Thu Jan  8 22:12:08 2009
@@ -1906,18 +1906,12 @@
     my $past := PAST::Var.new( :name($shortname), :namespace($ns), :node($/) );
 
     my $scope := '';
-    if +$ns == 0 {
-        our @?BLOCK;
-        if substr(~$/, 0, 2) eq '::' {
-            $scope := 'lexical';
-            $past.isdecl(1);
-        }
-        elsif @?BLOCK {
-            for @?BLOCK {
-                if defined($_) && !$scope {
-                    my $sym := $_.symbol($shortname);
-                    if defined($sym) && $sym<scope> { $scope := $sym<scope>; }
-                }
+    our @?BLOCK;
+    if +$ns == 0 && @?BLOCK {
+        for @?BLOCK {
+            if defined($_) && !$scope {
+                my $sym := $_.symbol($shortname);
+                if defined($sym) && $sym<scope> { $scope := $sym<scope>; }
             }
         }
     }
@@ -1928,7 +1922,12 @@
 
 
 method fulltypename($/) {
-    make $( $<typename> );
+    my $past := $( $<typename> );
+    if substr( ~$<typename>, 0, 2) eq '::' {
+        $past.isdecl(1);
+        $past.scope('lexical');
+    }
+    make $past;
 }
 
 



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