Skip to content

Commit

Permalink
Fixed the deparsing of an empty array that contains empty expressions…
Browse files Browse the repository at this point in the history
…, under -O1.

The following code failed to compile correcly:

	sidef -O1 -E 'assert_eq([(), (), ()], [])'
  • Loading branch information
trizen committed May 12, 2024
1 parent b811901 commit 9547182
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 @@ -504,7 +504,7 @@ HEADER
sub _dump_array {
my ($self, $ref, $array) = @_;
$self->load_mod($ref);
'bless([' . join(',', map { $self->deparse_expr(ref($_) eq 'HASH' ? $_ : {self => $_}) } @{$array}) . "], '${ref}')";
'bless([' . join(',', grep { $_ ne '' } map { $self->deparse_expr(ref($_) eq 'HASH' ? $_ : {self => $_}) } @{$array}) . "], '${ref}')";
}

sub _dump_indices {
Expand Down

0 comments on commit 9547182

Please sign in to comment.