From 68bb56ba66915fa81c3ea0918203565b350ae4c3 Mon Sep 17 00:00:00 2001 From: Jonathan Scott Duff Date: Sun, 21 Feb 2010 01:19:13 -0600 Subject: [PATCH] simplify statement_mod_loop logic a little --- src/Perl6/Actions.pm | 13 +++++-------- src/Perl6/Grammar.pm | 6 +++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm index 6a7bec65aba..63ebdabebb0 100644 --- a/src/Perl6/Actions.pm +++ b/src/Perl6/Actions.pm @@ -132,14 +132,11 @@ method statement($/, $key?) { } if $ml { if ~$ml eq 'for' { - my $block := PAST::Block.new( :blocktype('immediate'), + $past := PAST::Block.new( :blocktype('immediate'), PAST::Var.new( :name('$_'), :scope('parameter'), :isdecl(1) ), $past); - $past := PAST::Op.new($ml.ast, $block, :pasttype(~$ml), :node($/) ); - } - else { - $past := PAST::Op.new($ml.ast, $past, :pasttype(~$ml), :node($/) ); } + $past := PAST::Op.new($ml.ast, $past, :pasttype(~$ml), :node($/) ); } } elsif $ { $past := $.ast; } @@ -464,9 +461,9 @@ sub add_phaser($/, $bank) { method statement_mod_cond:sym($/) { make $.ast; } method statement_mod_cond:sym($/) { make $.ast; } -method statement_mod_loop:sym($/) { make $.ast; } -method statement_mod_loop:sym($/) { make $.ast; } -method statement_mod_loop:sym($/) { make $.ast; } +method statement_mod_loop:sym($/) { make $.ast; } +method statement_mod_loop:sym($/) { make $.ast; } +method statement_mod_loop:sym($/) { make $.ast; } ## Terms diff --git a/src/Perl6/Grammar.pm b/src/Perl6/Grammar.pm index 860e10bd07c..680bd0e9426 100644 --- a/src/Perl6/Grammar.pm +++ b/src/Perl6/Grammar.pm @@ -423,9 +423,9 @@ token statement_mod_cond:sym { :s } proto token statement_mod_loop { <...> } -token statement_mod_loop:sym { :s } -token statement_mod_loop:sym { :s } -token statement_mod_loop:sym { :s } +token statement_mod_loop:sym { :s } +token statement_mod_loop:sym { :s } +token statement_mod_loop:sym { :s } ## Terms