From: Steve Hancock Date: Fri, 24 Jun 2022 20:14:10 +0000 (-0700) Subject: remove perl 5.8 from test matrix X-Git-Tag: 20220613.01~22 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d3249f25ff81635a5af12383bfdf2011e50de732;p=perltidy.git remove perl 5.8 from test matrix --- diff --git a/.github/workflows/perltest.yml b/.github/workflows/perltest.yml index 970e6894..d4a0ab91 100644 --- a/.github/workflows/perltest.yml +++ b/.github/workflows/perltest.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - perl: [ '5.8', '5.10', '5.12', '5.14', '5.30', '5.32', 'latest' ] + perl: [ '5.10', '5.12', '5.14', '5.30', '5.32', 'latest' ] # Using the value from the matrix above we select the platform (operating system) to run on runs-on: ${{ matrix.os }} diff --git a/.perlcriticrc b/.perlcriticrc index f2cad15c..47eacb0d 100644 --- a/.perlcriticrc +++ b/.perlcriticrc @@ -71,7 +71,7 @@ verbose = %f: [%p] %m at line %l, column %c.\n # The max values below can be reduced to locate code which might be improved. [Subroutines::ProhibitExcessComplexity] -max_mccabe=245 +max_mccabe=185 [ControlStructures::ProhibitDeepNests] max_nests=8 diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 894bb70a..a05da934 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -2047,22 +2047,23 @@ EOM my $i_begin = $i; my $tok_begin = $tok; + my $i_plus_1 = $i + 1; my $fast_scan_type; ############################### # quick scan with leading sigil ############################### if ( !$id_scan_state - && $i + 1 <= $max_token_index + && $i_plus_1 <= $max_token_index && $fast_scan_context{$tok} ) { $context = $fast_scan_context{$tok}; # look for $var, @var, ... - if ( $rtoken_type->[ $i + 1 ] eq 'w' ) { + if ( $rtoken_type->[$i_plus_1] eq 'w' ) { my $pretype_next = EMPTY_STRING; - my $i_next = $i + 2; - if ( $i_next <= $max_token_index ) { + if ( $i_plus_1 < $max_token_index ) { + my $i_next = $i_plus_1 + 1; if ( $rtoken_type->[$i_next] eq 'b' && $i_next < $max_token_index ) { @@ -2073,10 +2074,10 @@ EOM if ( $pretype_next ne ':' && $pretype_next ne "'" ) { # Found type 'i' like '$var', '@var', or '%var' - $identifier = $tok . $rtokens->[ $i + 1 ]; + $identifier = $tok . $rtokens->[$i_plus_1]; $tok = $identifier; $type = 'i'; - $i = $i + 1; + $i = $i_plus_1; $fast_scan_type = $type; } } @@ -2085,7 +2086,7 @@ EOM # But we must let the full scanner handle things ${ because it may # keep going to get a complete identifier like '${#}' . elsif ( - $rtoken_type->[ $i + 1 ] eq '{' + $rtoken_type->[$i_plus_1] eq '{' && ( $tok_begin eq '@' || $tok_begin eq '%' ) ) @@ -2104,8 +2105,8 @@ EOM elsif ( $tok eq '->' && $i < $max_token_index - && ( $rtokens->[ $i + 1 ] eq '{' - || $rtokens->[ $i + 1 ] eq '[' ) + && ( $rtokens->[$i_plus_1] eq '{' + || $rtokens->[$i_plus_1] eq '[' ) ) { $type = $tok;