From: Steve Hancock Date: Sat, 30 Sep 2023 03:41:38 +0000 (-0700) Subject: remove unused code X-Git-Tag: 20230912.03~17 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4a348a299289aa0f2400fd96b3c76e8a30029183;p=perltidy.git remove unused code --- diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index bfb82178..1a08f481 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -1843,6 +1843,11 @@ sub set_line_separator { my $buf = join EMPTY_STRING, @lines; $rinput_string = \$buf; } + + # unknown line ending scheme - leave it alone and let the tokenizer + # deal with it + else { + } } } diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index f853109e..912eb16e 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -10559,31 +10559,6 @@ sub copy_token_as_type { # This provides a quick way to create a new token by # slightly modifying an existing token. my ( $rold_token, $type, $token ) = @_; - if ( !defined($token) ) { - - $token = - $type eq 'b' ? SPACE - : $type eq 'q' ? EMPTY_STRING - : $type eq '->' ? $type - : $type eq ';' ? $type - : $type eq ',' ? $type - : undef; - - if ( !defined($token) ) { - - $token = $type; - - # Unexpected type ... this sub will work as long as both $token and - # $type are defined, but we should catch any unexpected types during - # development. - if (DEVEL_MODE) { - Fault(<' or ';' -EOM - } - - } - } my @rnew_token = @{$rold_token}; $rnew_token[_TYPE_] = $type; @@ -31303,6 +31278,10 @@ sub set_vertical_tightness_flags { elsif ( $is_opening_type{$type_end_next} ) { $ovt = 0; } + + # neither opening nor closing + else { + } } # The flag '_rbreak_container_' avoids conflict of -bom and -pt=1