Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Couple of some AST building tweaks to enable better code-gen.
  • Loading branch information
jnthn committed Jul 21, 2012
1 parent edf1a73 commit 35d8ceb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/QPerl6/Actions.pm
Expand Up @@ -512,7 +512,9 @@ class QPerl6::Actions is HLL::Actions {
elsif $ast<bare_block> {
$ast := $ast<bare_block>;
}
$ast := QAST::Stmt.new($ast, :returns($ast.returns)) if $ast ~~ QAST::Node;
else {
$ast := QAST::Stmt.new($ast, :returns($ast.returns)) if $ast ~~ QAST::Node;
}
$past.push( $ast );
}
}
Expand Down Expand Up @@ -1393,13 +1395,13 @@ class QPerl6::Actions is HLL::Actions {
:op('callmethod'), :name('clone'),
QAST::WVal.new( :value($throwaway_block) )
));
$block.push($fixup);
$block[1].push($fixup);

# As its last act, it should grab the current lexpad so that
# we have the type environment, and also return the parametric
# role we're in (because if we land it through a multi-dispatch,
# we won't know).
$block.push(QAST::Op.new(
$block[1].push(QAST::Op.new(
:op('list'),
QAST::WVal.new( :value($*PACKAGE) ),
QAST::Op.new( :op('curlexpad') )));
Expand Down

0 comments on commit 35d8ceb

Please sign in to comment.