Author: bernhard
Date: Fri Jan  2 09:09:20 2009
New Revision: 34824

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

Log:
[Pipp] Declare register vars in PAST, not in PIR


Modified: trunk/languages/pipp/src/pct/actions.pm
==============================================================================
--- trunk/languages/pipp/src/pct/actions.pm     (original)
+++ trunk/languages/pipp/src/pct/actions.pm     Fri Jan  2 09:09:20 2009
@@ -220,7 +220,7 @@
     # The object is the first argument
     $cons_call.unshift(
         PAST::Op.new(
-            :inline('.local pmc obj', '%r = new %0', 'obj = %r'),
+            :inline('%r = new %0', 'obj = %r'),
             $class_name
         )
     );
@@ -234,26 +234,24 @@
 
     make
         PAST::Stmts.new(
+            PAST::Var.new( :name('obj'),  :scope('register'), :isdecl(1) ),
+            PAST::Var.new( :name('cons'), :scope('register'), :isdecl(1) ),
             PAST::Op.new(                    # check whether there is a 
constructor
                 :pasttype('if'), 
                 PAST::Op.new(
                     :pirop('isnull'),
                     PAST::Op.new(
-                        :inline("%r = get_global ['" ~ $class_name ~ "'], 
'__construct'", '.local pmc cons', 'cons = %r # condition')
+                        :inline("%r = get_global ['" ~ $class_name ~ "'], 
'__construct'", 'cons = %r')  # condition
                     )
                 ),
                 PAST::Op.new(                                 # no constructor 
call needed
-                    :inline('.local pmc obj',
-                            '%r = new %0',
+                    :inline('%r = new %0',
                             'obj = %r'),
                     $class_name
                 ),
                 $cons_call                                    # call the 
constructor
             ),
-            PAST::Var.new(                                    # return the 
created object
-                :name('obj'),
-                :scope('register')
-            )
+            PAST::Var.new( :name('obj'), :scope('register') ) # return the 
created object
         );
 }
 

Reply via email to