develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34499 - in trunk/languages/pipp/src: common pct

From:
bernhard
Date:
December 28, 2008 08:51
Subject:
[svn:parrot] r34499 - in trunk/languages/pipp/src: common pct
Message ID:
20081228165110.14A61CB9FA@x12.develooper.com
Author: bernhard
Date: Sun Dec 28 08:51:09 2008
New Revision: 34499

Modified:
   trunk/languages/pipp/src/common/php_array.pir
   trunk/languages/pipp/src/pct/actions.pm

Log:
[Pipp] small cleanup in grammar and in php_array.pir
Courtesy of Daniel Keane.


Modified: trunk/languages/pipp/src/common/php_array.pir
==============================================================================
--- trunk/languages/pipp/src/common/php_array.pir	(original)
+++ trunk/languages/pipp/src/common/php_array.pir	Sun Dec 28 08:51:09 2008
@@ -78,7 +78,7 @@
         goto args_loop
     add_var:
         array[$I1] = $P0
-        $I1 = $I1 + 1
+        inc $I1
         goto end
     end:
         goto args_loop

Modified: trunk/languages/pipp/src/pct/actions.pm
==============================================================================
--- trunk/languages/pipp/src/pct/actions.pm	(original)
+++ trunk/languages/pipp/src/pct/actions.pm	Sun Dec 28 08:51:09 2008
@@ -182,13 +182,6 @@
                     :node( $/ )
                 );
   
-                #for $<expression> {
-                #$past.push( $($_) );
-                #}
-
-                #for $<key_value_pair> {
-                #$past.push( $($_) );
-                #}
     for $<array_argument> {
         $past.push( $($_) );
     }   
@@ -201,15 +194,15 @@
 }
 
 method key_value_pair($/) { 
-   my $past := PAST::Op.new(
-                    :node( $/ ),
-                    :pasttype( 'call' ),
-                    :name( 'infix:=>' ),
-                    :returns( 'Array' ),
-                    $( $<key> ),
-                    $( $<value> )
-            );
-   make $past;
+   make 
+       PAST::Op.new(
+           :node( $/ ),
+           :pasttype( 'call' ),
+           :name( 'infix:=>' ),
+           :returns( 'Array' ),
+           $( $<key> ),
+           $( $<value> )
+       );
 }
 
 method method_call($/) {
@@ -222,16 +215,15 @@
 }
 
 method constructor_call($/) {
-    my $past := PAST::Op.new(
-                    :name( 'new' ),
-                    :pasttype( 'callmethod' ),
-                    PAST::Var.new(
-                        :name( ~$<CLASS_NAME> ),
-                        :scope( 'package' ),
-                    )
-                );
-
-    make $past;
+    make
+        PAST::Op.new(
+            :name( 'new' ),
+            :pasttype( 'callmethod' ),
+            PAST::Var.new(
+                :name( ~$<CLASS_NAME> ),
+                :scope( 'package' ),
+            )
+        );
 }
 
 method constant($/) {



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