Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[dotnet] Compile for to $expr.map($block).eager rather the for pastty…
…pe for the time being.
  • Loading branch information
jnthn committed Nov 13, 2010
1 parent 08510b7 commit ec09403
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions dotnet/compiler/Actions.pm
Expand Up @@ -190,16 +190,23 @@ method statement_control:sym<repeat>($/) {
}

method statement_control:sym<for>($/) {
my $past := $<xblock>.ast;
$past.pasttype('for');
my $block := $past[1];
my $xb := $<xblock>.ast;
my $expr := $xb[0];
my $block := $xb[1];
unless $block.arity {
$block[0].push( PAST::Var.new( :name('$_'), :scope('parameter') ) );
$block.symbol('$_', :scope('lexical') );
$block.arity(1);
}
$block.blocktype('immediate');
make $past;
$block.blocktype('declaration');
make PAST::Op.new(
:pasttype('callmethod'), :name('eager'),
PAST::Op.new(
:pasttype('callmethod'), :name('map'),
$expr,
$block
)
);
}

method statement_control:sym<return>($/) {
Expand Down

0 comments on commit ec09403

Please sign in to comment.