&& defined($Kfirst)
&& $rLL->[$Klimit]->[_TYPE_] eq '#'
&& ( $Klimit > $Kfirst || $CODE_type eq 'HSC' )
- && ( !$CODE_type || $CODE_type eq 'HSC' || $CODE_type eq 'IO' );
+ && (!$CODE_type
+ || $CODE_type eq 'HSC'
+ || $CODE_type eq 'IO'
+ || $CODE_type eq 'NIN' );
- if ( $rOpts_delete_closing_side_comments
+ if (
+ $rOpts_delete_closing_side_comments
&& !$delete_side_comment
&& defined($Kfirst)
&& $Klimit > $Kfirst
&& $rLL->[$Klimit]->[_TYPE_] eq '#'
- && ( !$CODE_type || $CODE_type eq 'HSC' || $CODE_type eq 'IO' )
+ && ( !$CODE_type
+ || $CODE_type eq 'HSC'
+ || $CODE_type eq 'IO'
+ || $CODE_type eq 'NIN' )
)
{
my $token = $rLL->[$Klimit]->[_TOKEN_];
}, $class;
}
+sub set_line_separator {
+ my ( $self, $val ) = @_;
+ $self->{_line_separator} = $val;
+ return;
+}
+
sub write_line {
my ( $self, $line ) = @_;
=over 4
+=item B<Allow --delete-side-comments to work with -nanl>
+
+The -nanl flag (--noadd-newlines) was preventing side comments from being
+deleted, for example:
+
+ # perltidy -dsc -nanl
+ calc() # side comment
+
+The same issue was happening for --delete-closing-side comments.
+This has been fixed.
+
+18 Jun 2021.
+
=item B<Update welding rule to avoid unstable states>
Testing with random input parameters produced a formatting instability