]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix b1498
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 31 Oct 2024 15:25:44 +0000 (08:25 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 31 Oct 2024 15:25:44 +0000 (08:25 -0700)
dev-bin/run_convergence_tests.pl.data
dev-bin/run_convergence_tests.pl.expect
lib/Perl/Tidy.pm
lib/Perl/Tidy/Formatter.pm

index 5634792d06a4662d5778a7424927a389b0596ead..d335f8d4fd1f98009cd692ba10abea81e5b66c7b 100644 (file)
@@ -12441,6 +12441,18 @@ a b c d e );
 --break-at-trailing-comma-types='i'
 --qw-as-function
 
+==> b1498.in <==
+    $c->addtag( 'active', 'withtag',
+                ruler_make_tab( $c, $x, $y, $rinfo ), );
+    $c->addtag( 'active', 'withtag',
+                ruler_make_tab( $c, $x, $y, $rinfo ),
+    );
+
+==> b1498.par <==
+--maximum-line-length=61
+--line-up-parentheses
+--break-at-trailing-comma-types='b'
+
 ==> b156.in <==
 # State 1
 {
index 7798586342ffe63b23a8a7d0ff58a1f67e301cd3..81dd7c699197339e69456d080d5ce3d574e93349 100644 (file)
@@ -8406,6 +8406,16 @@ my @abc
      = qw( a b c d e
      );
 
+==> b1498 <==
+    $c->addtag(
+                'active', 'withtag',
+                ruler_make_tab( $c, $x, $y, $rinfo ),
+    );
+    $c->addtag(
+                'active', 'withtag',
+                ruler_make_tab( $c, $x, $y, $rinfo ),
+    );
+
 ==> b156 <==
 # State 1
 {
index 8a86f9251f210b39d8a7ae8ce59bd38788635018..8d5605bc24e9003cfe2e654258781c6dc8476586 100644 (file)
@@ -2722,7 +2722,7 @@ EOM
 } ## end sub process_filter_layer
 
 # For safety, set an upper bound on number of iterations before stopping.
-# The average number of iterations is 2. No known cases exceed 3.
+# The average number of iterations is 2. No known cases exceed 4.
 use constant ITERATION_LIMIT => 6;
 
 sub process_iteration_layer {
index 40902a4b560e5181be3414d1017d1d62f18663b8..43d7b8b97e67c9e229019d93f4b78351ded5e42a 100644 (file)
@@ -39272,17 +39272,23 @@ sub set_vertical_tightness_flags {
         # token .. and be sure this line does not have a side comment
         #--------------------------------------------------------------
         my $token_next = $tokens_to_go[$ibeg_next];
-        if (   $type_sequence_to_go[$ibeg_next]
+        if (
+               $type_sequence_to_go[$ibeg_next]
             && !$block_type_to_go[$ibeg_next]
             && $is_closing_token{$token_next}
-            && $types_to_go[$iend] ne '#' )    # for safety, shouldn't happen!
+            && !$self->[_rbreak_container_]
+            ->{ $type_sequence_to_go[$ibeg_next] }    # b1498
+            && $types_to_go[$iend] ne '#'
+          )    # for safety, shouldn't happen!
         {
-            my $cvt = $closing_vertical_tightness{$token_next};
+            my $cvt   = $closing_vertical_tightness{$token_next};
+            my $seqno = $type_sequence_to_go[$ibeg_next];
 
             # Avoid conflict of -bom and -pvt=1 or -pvt=2, fixes b977, b1303
             # See similar patch above for $ovt.
-            my $seqno = $type_sequence_to_go[$ibeg_next];
-            if ( $cvt && $self->[_rbreak_container_]->{$seqno} ) {
+            # NOTE: this is overriden by fix for b1498 above and can
+            # eventually be removed.
+            if ( 0 && $cvt && $self->[_rbreak_container_]->{$seqno} ) {
                 $cvt = 0;
             }