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

[svn:parrot] r35805 - trunk/languages/pipp/src/pct

From:
bernhard
Date:
January 20, 2009 06:06
Subject:
[svn:parrot] r35805 - trunk/languages/pipp/src/pct
Message ID:
20090120140633.3FF05CB9AE@x12.develooper.com
Author: bernhard
Date: Tue Jan 20 06:06:32 2009
New Revision: 35805

Modified:
   trunk/languages/pipp/src/pct/actions.pm

Log:
[Pipp] Create the class in the 'open' block

Modified: trunk/languages/pipp/src/pct/actions.pm
==============================================================================
--- trunk/languages/pipp/src/pct/actions.pm	(original)
+++ trunk/languages/pipp/src/pct/actions.pm	Tue Jan 20 06:06:32 2009
@@ -668,25 +668,13 @@
     our $?CLASS; # for namespacing of constants
 
     if $key eq 'open' {
+        # Start of class definition; make PAST to create class object
         $?CLASS := ~$<class_name>;
         my $block := PAST::Block.new(
-                :node($/),
-                :blocktype('declaration'),
-                :pirflags( ':init :load' ),
-                :namespace( $?CLASS )
-            );
-
-        # set up scope 'package' for the superglobals
-        our @?SUPER_GLOBALS;
-        for ( @?SUPER_GLOBALS ) { $block.symbol( :scope('package'), $_ ); }
-
-        @?BLOCK.unshift( $block );
-    }
-    else {
-        my $block := @?BLOCK.shift();
-        $block.push(
-            # Start of class definition; make PAST to create class object if
-            # we're creating a new class.
+            :node($/),
+            :blocktype('declaration'),
+            :pirflags( ':init :load' ),
+            :namespace($?CLASS),
             PAST::Op.new(
                 :pasttype('bind'),
                 PAST::Var.new(
@@ -702,7 +690,15 @@
             )
         );
 
-        # nothing to do for $<const_definition,
+        # set up scope 'package' for the superglobals
+        our @?SUPER_GLOBALS;
+        for ( @?SUPER_GLOBALS ) { $block.symbol( :scope('package'), $_ ); }
+
+        @?BLOCK.unshift( $block );
+    }
+    else {
+        my $block := @?BLOCK.shift();
+
         # setup of class constants is done in the 'loadinit' node
         for $<constant_definition> {
             $block.push( $($_) );



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