]> git.donarmstrong.com Git - perltidy.git/commitdiff
eliminate unused variables
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 7 Apr 2024 03:49:24 +0000 (20:49 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 7 Apr 2024 03:49:24 +0000 (20:49 -0700)
lib/Perl/Tidy.pm
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/HtmlWriter.pm
lib/Perl/Tidy/Tokenizer.pm
lib/Perl/Tidy/VerticalAligner.pm

index 7316285751f61939597f3ec454f7963c6e9e28ab..1227bf9209124e9f44009ac94141d0685ef32872 100644 (file)
@@ -3350,7 +3350,6 @@ sub generate_options {
     my %expansion       = ();
     my %option_category = ();
     my %option_range    = ();
-    my $rexpansion      = \%expansion;
     my %integer_option_range;
 
     # names of categories in manual
index 3ff52c6362dbabd1461a36a7a894814a3c7fe2cc..b1a6920bf617fac9025618f3b2e713c2b2378f0b 100644 (file)
@@ -12522,8 +12522,6 @@ sub store_new_token {
         # Be Careful: we are working on the top of the new stack, on a token
         # which has been stored.
 
-        my $rcopy = copy_token_as_type( $rLL_new->[$Ktop], 'b', SPACE );
-
         $rLL_new->[$Ktop]->[_TOKEN_]        = $token;
         $rLL_new->[$Ktop]->[_TOKEN_LENGTH_] = length($token);
         $rLL_new->[$Ktop]->[_TYPE_]         = $type;
@@ -12539,9 +12537,6 @@ sub store_new_token {
                 $self->[_rtype_count_by_seqno_]->{$seqno}->{$type}++;
             }
         }
-
-        # Then store a new blank
-        ## $self->store_token($rcopy);
     }
     else {
 
@@ -13124,7 +13119,6 @@ sub package_info_maker {
     #  which are two lists with useful information on all packages
 
     my $rLL                 = $self->[_rLL_];
-    my $rlines              = $self->[_rlines_];
     my $K_closing_container = $self->[_K_closing_container_];
     my $Klimit              = @{$rLL} - 1;
 
@@ -13843,10 +13837,7 @@ sub sub_def_info_maker {
 
     my ( $self, $rpackage_lookup_list ) = @_;
 
-    my $rK_sub_by_seqno     = $self->[_rK_sub_by_seqno_];
-    my $ris_my_sub_by_seqno = $self->[_ris_my_sub_by_seqno_];
-    my $rsub_call_paren_info_by_seqno =
-      $self->[_rsub_call_paren_info_by_seqno_];
+    my $rK_sub_by_seqno = $self->[_rK_sub_by_seqno_];
 
     # Returns: \%sub_info_hash, which contains sub call info:
     #  $sub_info_hash->{$package::$name}->{
@@ -13864,11 +13855,8 @@ sub sub_def_info_maker {
 
     my $rLL                  = $self->[_rLL_];
     my $K_opening_container  = $self->[_K_opening_container_];
-    my $K_closing_container  = $self->[_K_closing_container_];
     my $rblock_type_of_seqno = $self->[_rblock_type_of_seqno_];
     my $ris_sub_block        = $self->[_ris_sub_block_];
-    my $rK_next_seqno_by_K   = $self->[_rK_next_seqno_by_K_];
-    my $rtype_count_by_seqno = $self->[_rtype_count_by_seqno_];
 
     my @package_stack = reverse( @{$rpackage_lookup_list} );
     my ( $current_package, $Kbegin, $Kend ) = @{ pop @package_stack };
@@ -13969,7 +13957,6 @@ sub update_sub_call_paren_info {
     my $rLL                  = $self->[_rLL_];
     my $K_opening_container  = $self->[_K_opening_container_];
     my $K_closing_container  = $self->[_K_closing_container_];
-    my $rK_next_seqno_by_K   = $self->[_rK_next_seqno_by_K_];
     my $rtype_count_by_seqno = $self->[_rtype_count_by_seqno_];
     my $rsub_call_paren_info_by_seqno =
       $self->[_rsub_call_paren_info_by_seqno_];
@@ -14121,9 +14108,7 @@ sub cross_check_call_args {
     $ris_mismatched_call_excluded_name->{AUTOLOAD} = 1;
     $ris_mismatched_call_excluded_name->{DESTROY}  = 1;
 
-    my $rLL                 = $self->[_rLL_];
     my $rK_package_list     = $self->[_rK_package_list_];
-    my $rK_sub_by_seqno     = $self->[_rK_sub_by_seqno_];
     my $ris_my_sub_by_seqno = $self->[_ris_my_sub_by_seqno_];
     my $rsub_call_paren_info_by_seqno =
       $self->[_rsub_call_paren_info_by_seqno_];
@@ -23407,7 +23392,7 @@ sub break_equals {
             my $ibeg_2 = $ri_beg->[$nn];
 
             # Define certain good joint tokens
-            my ( $itok, $itokp, $itokm );
+            my $itok;
             foreach my $itest ( $iend_1, $ibeg_2 ) {
                 my $type = $types_to_go[$itest];
                 if (   $is_math_op{$type}
@@ -31038,7 +31023,6 @@ EOM
     }
     my ( $ibeg, $iend );
     foreach my $n ( 0 .. $nmax ) {
-        my $ibeg_m = $ibeg;
         my $iend_m = $iend;
         $ibeg = $ri_first->[$n];
         $iend = $ri_last->[$n];
@@ -33512,7 +33496,7 @@ sub xlp_tweak {
                 && $levels_to_go[$ibeg] eq $levels_to_go[$iterm] )
             {
                 $container_name{'0'} =
-                  make_uncontained_comma_name( $iterm, $ibeg, $iend );
+                  make_uncontained_comma_name( $iterm, $ibeg );
             }
         }
 
@@ -33851,7 +33835,7 @@ sub xlp_tweak {
     } ## end sub make_alignment_patterns
 
     sub make_uncontained_comma_name {
-        my ( $iterm, $ibeg, $iend ) = @_;
+        my ( $iterm, $ibeg ) = @_;
 
         # Make a container name by combining all leading barewords,
         # keywords and functions.
@@ -36352,7 +36336,6 @@ sub wrapup {
 
     my $first_tabbing_disagreement = $self->[_first_tabbing_disagreement_];
     my $last_tabbing_disagreement  = $self->[_last_tabbing_disagreement_];
-    my $tabbing_disagreement_count = $self->[_tabbing_disagreement_count_];
     my $in_tabbing_disagreement    = $self->[_in_tabbing_disagreement_];
 
     if ($first_tabbing_disagreement) {
index febf10a4c1ed879d91a93e9167ec25d0f046a55f..5c2189786ecdc28f9cd57bc98ec605a83c51b7fb 100644 (file)
@@ -428,10 +428,11 @@ BEGIN {
 
 sub make_getopt_long_names {
     my ( $class, $rgetopt_names ) = @_;
-    while ( my ( $short_name, $name ) = each %short_to_long_names ) {
-        push @{$rgetopt_names}, "html-color-$name=s";
-        push @{$rgetopt_names}, "html-italic-$name!";
-        push @{$rgetopt_names}, "html-bold-$name!";
+    foreach my $short_name ( keys %short_to_long_names ) {
+        my $long_name = $short_to_long_names{$short_name};
+        push @{$rgetopt_names}, "html-color-$long_name=s";
+        push @{$rgetopt_names}, "html-italic-$long_name!";
+        push @{$rgetopt_names}, "html-bold-$long_name!";
     }
     push @{$rgetopt_names}, "html-color-background=s";
     push @{$rgetopt_names}, "html-linked-style-sheet=s";
@@ -688,7 +689,6 @@ sub pod_to_html {
     # return 1 if success, 0 otherwise
     my ( $self, $pod_string, $css_string, $toc_string, $rpre_string_stack ) =
       @_;
-    my $input_file   = $self->{_input_file};
     my $title        = $self->{_title};
     my $success_flag = 0;
 
@@ -990,7 +990,6 @@ sub make_frame {
     #  $html_filename contains the no-frames html output
     #  $rtoc is a reference to an array with the table of contents
     my ( $self, $rtoc ) = @_;
-    my $input_file    = $self->{_input_file};
     my $html_filename = $self->{_html_file};
     my $toc_filename  = $self->{_toc_filename};
     my $src_filename  = $self->{_src_filename};
index effdcfd35ea84dadb529099900ac72abb5ad72c8..bb07297ba0f54c50e00c61571c6de41772199057 100644 (file)
@@ -7991,7 +7991,7 @@ sub scan_id_do {
 
     use constant DEBUG_NSCAN => 0;
     my $type = EMPTY_STRING;
-    my ( $i_beg, $pos_beg );
+    my $i_beg;
 
     #print "NSCAN:entering i=$i, tok=$tok, type=$type, state=$id_scan_state\n";
     #my ($a,$b,$c) = caller;
index 92be8366e3d13210772c37fc9e22d029f72aa321..333f03e76d293ecbba3a8ae71d13859b83c13a03 100644 (file)
@@ -6373,8 +6373,7 @@ sub get_output_line_number {
         my $level_end                 = $rinput->{level_end};
         my $maximum_line_length       = $rinput->{maximum_line_length};
 
-        my ( $open_or_close, $opening_flag, $closing_flag, $seqno, $valid,
-            $seqno_beg, $seqno_end );
+        my ( $open_or_close, $seqno_beg );
         if ($rvertical_tightness_flags) {
 
             $open_or_close = $rvertical_tightness_flags->{_vt_type};