]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix b1234.in, make token type after '->' consistent
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 4 Nov 2021 00:31:06 +0000 (17:31 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 4 Nov 2021 00:31:06 +0000 (17:31 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Tokenizer.pm

index 90ce7ec1413fb2e86e1c39f69f37fceaf32166ab..ba7b5939213b76a5aff9af2ac44847ca6540bc39 100644 (file)
@@ -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
index 0d3ef5d70d3b2d8ff31273552f6b3b680ce43906..64d3ded29c91336d2c3a6466ea589bd4433782f4 100644 (file)
@@ -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' }