From 4a348a299289aa0f2400fd96b3c76e8a30029183 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 29 Sep 2023 20:41:38 -0700 Subject: [PATCH] remove unused code --- lib/Perl/Tidy.pm | 5 +++++ lib/Perl/Tidy/Formatter.pm | 29 ++++------------------------- 2 files changed, 9 insertions(+), 25 deletions(-) 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 -- 2.39.5