Skip to content

Commit

Permalink
- Minor fix in deparsing the __BLOCK__ keyword.
Browse files Browse the repository at this point in the history
Example:

	say { |n|
		# will call the block as a block (not as a function)
		n < 2 ? n : (__BLOCK__(n-1) + __BLOCK__(n-2))
	}(12)
  • Loading branch information
trizen committed Dec 13, 2015
1 parent 782e847 commit 572cabb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Sidef/Deparse/Perl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ HEADER
}
elsif ($ref eq 'Sidef::Types::Block::BlockInit') {
if ($addr{$refaddr}++) {
$code = 'Sidef::Types::Block::Block->new(code => __SUB__';
$code = q{Sidef::Types::Block::Block->new(code => __SUB__, type => 'block'};

if (exists($obj->{init_vars}) and @{$obj->{init_vars}{vars}}) {
$code .= ', ' . $self->_dump_var_attr(@{$obj->{init_vars}{vars}});
Expand Down

0 comments on commit 572cabb

Please sign in to comment.