Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Start to sketch out QAST::Block handling; loads more to do, of course.
  • Loading branch information
jnthn committed Apr 22, 2012
1 parent 2a08246 commit 6b2e5b2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/QAST/Compiler.nqp
Expand Up @@ -60,10 +60,22 @@ class QAST::Compiler is HLL::Compiler {
proto method as_post(*@args, *%_) { * }
multi method as_post(QAST::Block $node) {
# Fresh registers.
# Block gets completely fresh registers.
my $*REGALLOC := RegAlloc.new();
# DO ALL THE STUFFS
# First need to compile all of the statements.
my $stmts := self.compile_all_the_stmts($node.list);
# XXX Generate parameter handling code.
my $params := self.post_new('Ops');

# Wrap all up in a POST::Sub.
my $sub := self.post_new('Sub');
$sub.push($params);
$sub.push($stmts);
$sub.push(".return (" ~ $stmts.result ~ ")");

$sub
}

multi method as_post(QAST::Stmt $node) {
Expand Down

0 comments on commit 6b2e5b2

Please sign in to comment.