From b498914f697aa426200b3e684132552556e547a0 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sat, 15 Oct 2022 08:18:18 -0700 Subject: [PATCH] remove unused code; minor optimization --- lib/Perl/Tidy/Tokenizer.pm | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index cd93f0ce..6f2d774f 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -5219,6 +5219,13 @@ EOM $level_i = --$level_in_tokenizer; + if ( $level_in_tokenizer < 0 ) { + unless ( $self->[_saw_negative_indentation_] ) { + $self->[_saw_negative_indentation_] = 1; + warning("Starting negative indentation\n"); + } + } + # restore previous level values if ( length($nesting_block_string) > 1 ) { # true for valid script @@ -5301,10 +5308,6 @@ EOM ); ##if $routput_container_type->[$i] =~ /^[;,\{\}]$/; } - - elsif ( $tok_i eq ';' ) { - $in_statement_continuation = 0; - } } ## end if ( length($nesting_block_string...)) $ci_string_i = $ci_string_sum + $in_statement_continuation; @@ -5394,12 +5397,6 @@ EOM #------------------------------------------- # Section 4: operations common to all levels #------------------------------------------- - if ( $level_in_tokenizer < 0 ) { - unless ( $self->[_saw_negative_indentation_] ) { - $self->[_saw_negative_indentation_] = 1; - warning("Starting negative indentation\n"); - } - } # set secondary nesting levels based on all containment token # types Note: these are set so that the nesting depth is the -- 2.39.5