@@ -775,6 +775,7 @@ sub _coderef_slurpy {
775775 input_slot => ' $SLURPY' ,
776776 display_var => ' $SLURPY' ,
777777 index => 0,
778+ is_slurpy => 1,
778779 $self -> is_named
779780 ? ( output_slot => sprintf ( ' $out{%s}' , B::perlstring( $parameter -> name ) ) )
780781 : ( output_var => ' @out' )
@@ -829,7 +830,7 @@ sub _coderef_end {
829830 }
830831
831832 $self -> _coderef_end_extra( $coderef );
832- $coderef -> add_line( $self -> _make_return_expression( is_early => 0 ) . ' ;' );
833+ $coderef -> add_line( $self -> _make_return_expression( is_early => 0, allow_full_statements => 1 ) . ' ;' );
833834 $coderef -> {indent } =~ s /\t $// ;
834835 $coderef -> add_line( ' }' );
835836
@@ -892,9 +893,13 @@ sub _make_return_expression {
892893 elsif ( $list eq ' @_' ) {
893894 return sprintf ' goto( $__NEXT__ )' ;
894895 }
896+ elsif ( $args {allow_full_statements } and not ( $args {is_early } or not exists $args {is_early } ) ) {
897+ # We are allowed to return full statements, not
898+ # forced to use do {...} to make an expression.
899+ return sprintf ' @_ = ( %s ); goto $__NEXT__' , $list ;
900+ }
895901 else {
896- return sprintf ' do { @_ = ( %s ); goto $__NEXT__ }' ,
897- $list ;
902+ return sprintf ' do { @_ = ( %s ); goto $__NEXT__ }' , $list ;
898903 }
899904 }
900905 elsif ( $args {is_early } or not exists $args {is_early } ) {
0 commit comments