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

[svn:parrot] r34309 - trunk/languages/perl6/src/parser

From:
pmichaud
Date:
December 23, 2008 17:32
Subject:
[svn:parrot] r34309 - trunk/languages/perl6/src/parser
Message ID:
20081224013214.F39B2CBA12@x12.develooper.com
Author: pmichaud
Date: Tue Dec 23 17:32:14 2008
New Revision: 34309

Modified:
   trunk/languages/perl6/src/parser/actions.pm

Log:
[rakudo]:  Correct loop_statement to execute iteration expression on 'next'.


Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm	(original)
+++ trunk/languages/perl6/src/parser/actions.pm	Tue Dec 23 17:32:14 2008
@@ -287,10 +287,10 @@
     my $block := $( $<block> );
     $block.blocktype('immediate');
     my $cond  := $<e2> ?? $( $<e2>[0] ) !! 1;
+    my $loop := PAST::Op.new( $cond, $block, :pasttype('while'), :node($/) );
     if $<e3> {
-        $block := PAST::Stmts.new( $block, $( $<e3>[0] ) );
+        $loop.push( $( $<e3>[0] ) );
     }
-    my $loop := PAST::Op.new( $cond, $block, :pasttype('while'), :node($/) );
     if $<e1> {
         $loop := PAST::Stmts.new( $( $<e1>[0] ), $loop, :node($/) );
     }



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