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($/) {