Skip to content

Commit

Permalink
inlined blocks should handle leave
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Jun 2, 2011
1 parent 73294a2 commit 63d2925
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/NieczaPassBeta.pm6
Expand Up @@ -120,5 +120,5 @@ sub beta_optimize($body, $op, $inv, $cbody) {
$nop = ::Op::TopicalHook.new(inner => $nop);
}

$nop;
$cbody.transparent ?? $nop !! ::Op::LeaveHook.new(inner => $nop);
}
12 changes: 12 additions & 0 deletions src/niecza
Expand Up @@ -93,6 +93,18 @@ augment class Op::YouAreHere { #OK
}
}

class Op::LeaveHook is Op {
has $.inner;
method zyg() { $.inner }

method code($body) {
my $id = ::GLOBAL::NieczaActions.genid;

CgOp.xspan("start$id", "end$id", 0, $.inner.cgop($body),
11, '', "end$id");
}
}

class Op::GetBlock is Op {
has Bool $.routine;
method code($body is copy) {
Expand Down

0 comments on commit 63d2925

Please sign in to comment.