Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Update handling of block arity.
  • Loading branch information
pmichaud committed Nov 8, 2009
1 parent 1e2187a commit 457fa04
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/NQP/Actions.pm
Expand Up @@ -136,9 +136,11 @@ method statement_control:sym<for>($/) {
my $past := $<xblock>.ast;
$past.pasttype('for');
my $block := $past[1];
$block[0].push( PAST::Var.new( :name('$_'), :scope('parameter') ) );
$block.symbol('$_', :scope('lexical') );
$block.arity(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;
}
Expand Down Expand Up @@ -345,6 +347,7 @@ method parameter($/) {
}
$past.viviself( $<default_value>[0]<EXPR>.ast );
}
if $past.viviself { @BLOCK[0].arity( +@BLOCK[0].arity + 1 ); }
make $past;
}

Expand Down

0 comments on commit 457fa04

Please sign in to comment.