Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Prepare QAST -> Parrot for closure changes.
Again, just teaching it to ignore some new blocktypes for now.
  • Loading branch information
jnthn committed Sep 28, 2013
1 parent f19118f commit b86227e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vm/parrot/QAST/Compiler.nqp
Expand Up @@ -626,7 +626,7 @@ class QAST::Compiler is HLL::Compiler {
my $ops := PIRT::Ops.new();
$ops.push($sub);
my $blocktype := $node.blocktype;
if $blocktype eq 'immediate' {
if $blocktype eq 'immediate' || $blocktype eq 'immediate_static' {
# Look up and capture the block.
try @*INNERS.push($node.cuid());
my $breg := $*REGALLOC.fresh_p();
Expand All @@ -651,7 +651,7 @@ class QAST::Compiler is HLL::Compiler {
}
$ops.result($rreg);
}
elsif $blocktype eq 'declaration' || $blocktype eq '' {
elsif $blocktype eq 'declaration' || $blocktype eq 'declaration_static' || $blocktype eq '' {
# Get the block and newclosure it.
try @*INNERS.push($node.cuid());
my $breg := $*REGALLOC.fresh_p();
Expand Down
3 changes: 3 additions & 0 deletions src/vm/parrot/QAST/Operations.nqp
Expand Up @@ -668,6 +668,9 @@ QAST::Operations.add_core_op('for', :inlinable(1), -> $qastcomp, $op {
if @operands[1].blocktype eq 'immediate' {
@operands[1].blocktype('declaration');
}
elsif @operands[1].blocktype eq 'immediate_static' {
@operands[1].blocktype('declaration_static');
}

# Evaluate the thing we'll iterate over and the block.
my $res := $*REGALLOC.fresh_p();
Expand Down

0 comments on commit b86227e

Please sign in to comment.