remove unused code
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 30 Sep 2023 03:41:38 +0000 (20:41 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 30 Sep 2023 03:41:38 +0000 (20:41 -0700)
lib/Perl/Tidy.pm
lib/Perl/Tidy/Formatter.pm

index bfb821787ae9efc58508259c2a561fc51e6628c4..1a08f481daac40feb23c93862699dce099c6a1ab 100644 (file)
@@ -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 {
+            }
         }
     }
 
index f853109e8155fc03935638061db1d6b718e0d762..912eb16eebfc18feafac3513db2382be6cd10088 100644 (file)
@@ -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(<<EOM);
-sub 'copy_token_as_type' received token type '$type' but expects just one of: 'b' 'q' '->' 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