Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make it possible to return from macros
Kudos to moritz++ for discovering this use case.
  • Loading branch information
Carl Masak committed Oct 23, 2011
1 parent 991ade7 commit b1c555f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Perl6/Actions.pm
Expand Up @@ -1523,6 +1523,14 @@ class Perl6::Actions is HLL::Actions {

$block := $<blockoid>.ast;
$block.blocktype('declaration');
if is_clearly_returnless($block) {
$block[1] := PAST::Op.new(
:pirop('perl6_decontainerize_return_value PP'),
$block[1]);
}
else {
$block[1] := wrap_return_handler($block[1]);
}

# Obtain parameters, create signature object and generate code to
# call binder.
Expand Down

0 comments on commit b1c555f

Please sign in to comment.