From: Steve Hancock Date: Sun, 27 Mar 2022 14:01:44 +0000 (-0700) Subject: clean up comments X-Git-Tag: 20220217.03~29 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=85486317dd3e2499043dd20d6e5c5c52b8451bcb;p=perltidy.git clean up comments --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index d0425d47..e41de5bb 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -3287,12 +3287,10 @@ EOM # keep a space between a token ending in '$' and any word; # this caused trouble: "die @$ if $@" - ##|| $typel eq 'i' && $tokenl =~ /\$$/ || $typel eq 'i' && substr( $tokenl, -1, 1 ) eq '$' # don't combine $$ or $# with any alphanumeric # (testfile mangle.t with --mangle) - ##|| $tokenl =~ /^\$[\$\#]$/ || $tokenl eq '$$' || $tokenl eq '$#' @@ -3319,7 +3317,6 @@ EOM # perl is very fussy about spaces before << || substr( $tokenr, 0, 2 ) eq '<<' - ##|| $tokenr =~ /^\<\; - ##@is_uncontained_comma_break_excluded_type{@q} = (1) x scalar(@q); my @q = qw< k R } ) ] Y Z U w i q Q . = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=>; @@ -18361,8 +18352,6 @@ sub break_long_lines { # Switched from excluded to included for b1214. If necessary # the token could also be checked if type_m eq 'k' - ##if ( !$is_uncontained_comma_break_excluded_type{$type_m} ) { - ##my $token_m = $tokens_to_go[$ibreak_m]; if ( $is_uncontained_comma_break_included_type{$type_m} ) { $self->set_forced_breakpoint($ibreak); } @@ -18938,8 +18927,8 @@ EOM # Do not break hash braces under stress (fixes b1238) $do_not_break_apart ||= $types_to_go[$i_opening] eq 'L'; - # This option fixes b1235, b1237, b1240 with old and new -lp, - # but formatting is nicer with next option. + # This option fixes b1235, b1237, b1240 with old and new + # -lp, but formatting is nicer with next option. ## $is_long_term ||= ## $levels_to_go[$i_opening] > $stress_level_beta + 1; @@ -19575,8 +19564,6 @@ sub find_token_starting_list { # to the flag --space-function-paren, and similar. # previous loop: for ( my $j = $im1 ; $j >= 0 ; $j-- ) { for ( my $j = $iprev_nb ; $j >= 0 ; $j-- ) { - ##last if ( $types_to_go[$j] =~ /^[\(\[\{L\}\]\)Rb,]$/ ); - ##last if ( $is_key_type{ $types_to_go[$j] } ); if ( $is_key_type{ $types_to_go[$j] } ) { # fix for b1211 @@ -20722,7 +20709,7 @@ sub excess_line_length { # Therefore I have eliminated additional calls to subs from it. my ( $self, $ibeg, $iend, $ignore_right_weld ) = @_; - # Original expression for line length + # Original expression for line length: this is okay but slow ##$length = leading_spaces_to_go($ibeg) + token_sequence_length( $ibeg, $iend ); # This is basically sub 'leading_spaces_to_go': @@ -20877,7 +20864,6 @@ sub get_available_spaces_to_go { my $ris_excluded_lp_container = $self->[_ris_excluded_lp_container_]; my $rblock_type_of_seqno = $self->[_rblock_type_of_seqno_]; my $starting_in_quote = $self->[_this_batch_]->[_starting_in_quote_]; - my $K_opening_container = $self->[_K_opening_container_]; ##TESTING my $K_closing_container = $self->[_K_closing_container_]; my $rlp_object_by_seqno = $self->[_rlp_object_by_seqno_]; my $radjusted_levels = $self->[_radjusted_levels_]; @@ -20998,9 +20984,6 @@ sub get_available_spaces_to_go { } elsif ( $types_to_go[ $i_test + 1 ] eq 'b' ) { $i_test++ } - # TESTING - ##my $too_close = ($i_test==$ii-1); - my $test_position = total_line_length( $i_test, $ii ); my $mll = $maximum_line_length_at_level[ $levels_to_go[$i_test] ]; @@ -21020,9 +21003,6 @@ sub get_available_spaces_to_go { if ( - # the equals is not just before an open paren (testing) - ##!$too_close && - # if we might exceed the maximum line length $lp_position_predictor + $len_increase > $mll