diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm index f15a9b8390b..6a7bec65aba 100644 --- a/src/Perl6/Actions.pm +++ b/src/Perl6/Actions.pm @@ -131,7 +131,15 @@ method statement($/, $key?) { :pasttype(~$mc), :node($/) ); } if $ml { - $past := PAST::Op.new($ml.ast, $past, :pasttype(~$ml), :node($/) ); + if ~$ml eq 'for' { + my $block := 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($/) ); + } } } elsif $ { $past := $.ast; } @@ -458,6 +466,7 @@ 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; } ## Terms diff --git a/src/Perl6/Grammar.pm b/src/Perl6/Grammar.pm index 852b77f84dc..860e10bd07c 100644 --- a/src/Perl6/Grammar.pm +++ b/src/Perl6/Grammar.pm @@ -425,6 +425,7 @@ proto token statement_mod_loop { <...> } token statement_mod_loop:sym { :s } token statement_mod_loop:sym { :s } +token statement_mod_loop:sym { :s } ## Terms