From: Steve Hancock Date: Thu, 4 Nov 2021 00:31:06 +0000 (-0700) Subject: fix b1234.in, make token type after '->' consistent X-Git-Tag: 20211029.01~33 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ff8ad7e42e9d2111431fd9afbf2c4e42af54f776;p=perltidy.git fix b1234.in, make token type after '->' consistent --- diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 90ce7ec1..ba7b5939 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -7853,6 +7853,33 @@ $obj= {foo => sub { "bar" ; } --paren-vertical-tightness=1 --weld-nested-containers +==> b1234.in <== +# S1 +is( + Pack-> + $mname( + "a", "b", + "c" + ), +"method,a,b,c" +); + +# S2 +is( + Pack->$mname + ( + "a", "b", + "c" + ), +"method,a,b,c" +); + +==> b1234.par <== +--continuation-indentation=10 +--ignore-old-breakpoints +--maximum-line-length=12 +--variable-maximum-line-length + ==> b1236.in <== # Added level test when applying kpit # S1 diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 0d3ef5d7..64d3ded2 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -7649,7 +7649,14 @@ EOM if ($saw_type) { if ($saw_alpha) { - if ( $identifier =~ /^->/ && $last_nonblank_type eq 'w' ) { + + # The type without the -> should be the same as with the -> so + # that if they get separated we get the same bond strengths, + # etc. See b1234 + if ( $identifier =~ /^->/ + && $last_nonblank_type eq 'w' + && substr( $identifier, 2, 1 ) =~ /^\w/ ) + { $type = 'w'; } else { $type = 'i' }