Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make blorsts migrate blocks into thunks.
This fixes various bugs with e.g. block-less gather working wrongly
when adding a block worked.
  • Loading branch information
jnthn committed Apr 28, 2015
1 parent c5d7aa0 commit 4a8a61f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -1565,7 +1565,17 @@ Compilation unit '$file' contained the following violations:
}

method blorst($/) {
make block_closure($<block> ?? $<block>.ast !! make_thunk_ref($<statement>.ast, $/));
my $block;
if $<block> {
$block := $<block>.ast;
}
else {
my $stmt := $<statement>.ast;
$block := make_thunk_ref($stmt, $/);
migrate_blocks($*W.cur_lexpad, $block.ann('past_block'),
-> $b { $b.ann('statement_id') == $stmt.ann('statement_id') });
}
make block_closure($block);
}

# Statement modifiers
Expand Down

0 comments on commit 4a8a61f

Please sign in to comment.