]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix b1499
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 1 Nov 2024 23:39:45 +0000 (16:39 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 1 Nov 2024 23:39:45 +0000 (16:39 -0700)
dev-bin/perltidy_random_setup.pl
dev-bin/run_convergence_tests.pl.data
dev-bin/run_convergence_tests.pl.expect
lib/Perl/Tidy/Formatter.pm

index ca9b267b2f59b29b6fdcabae655b80f27efcb5f0..d1fea21047072d6df9c15a32dcbedb66b8aaae51 100755 (executable)
@@ -915,7 +915,7 @@ EOM
             'one-line-block-exclusion-list' =>
               [ 'sort', 'map', 'grep', 'eval', '*', 'zzyzx' ],
 
-            'break-at-trailing-comma-types' => [ '0', '*', 'm', 'b', 'h', 'i', ' ' ],
+            'break-at-trailing-comma-types' => [ '0', '1', 'm', 'b' ],
 
             'use-feature' => [ 'class', ' ', 'xyzzy' ],
 
index d335f8d4fd1f98009cd692ba10abea81e5b66c7b..0cce851d28f41f566a4d1d79eb6f1bf36d254441 100644 (file)
@@ -12453,6 +12453,21 @@ a b c d e );
 --line-up-parentheses
 --break-at-trailing-comma-types='b'
 
+==> b1499.in <==
+    ( $_[ 0 ] < 0 ) ?
+          -1 : (
+        ( $_[ 0 ] >0 ) ? 1 : 0 );
+
+    ( $_[0] < 0 ) ? -1 :
+      (
+        ( $_[0] > 0 ) ? 1 : 0 );
+
+==> b1499.par <==
+--maximum-line-length=25
+--variable-maximum-line-length
+--opening-paren-right
+--break-after-all-operators
+
 ==> b156.in <==
 # State 1
 {
index 81dd7c699197339e69456d080d5ce3d574e93349..c90d98cfc8b0d77a9198fb8bd2083a8bb24adb7b 100644 (file)
@@ -5657,7 +5657,8 @@ printf
             @theme_args =
               get_themes(
                 \%opt, (
-                    $2 ? $2 : (
+                    $2 ? $2 :
+                      (
                         shift(
                             @theme_args)
                           ||
@@ -5668,7 +5669,8 @@ printf
             @theme_args =
               get_themes(
                 \%opt, (
-                    $2 ? $2 : (
+                    $2 ? $2 :
+                      (
                         shift(
                             @theme_args)
                           ||
@@ -7606,13 +7608,15 @@ $last = after (
 
 ==> b1440 <==
         $comp = (
-            $form->[3] ? (
+            $form->[3] ?
+                  (
                 $im3->dummy( 0, 3 ) > 0 ) *
                   255 :
                   ( $im3 > 0 ) );
 
         $comp = (
-            $form->[3] ? (
+            $form->[3] ?
+                  (
                 $im3->dummy( 0, 3 ) > 0 ) *
                   255 :
                   ( $im3 > 0 ) );
@@ -8416,6 +8420,17 @@ my @abc
                 ruler_make_tab( $c, $x, $y, $rinfo ),
     );
 
+==> b1499 <==
+    ( $_[0] < 0 ) ?
+      -1 :
+      (
+        ( $_[0] > 0 ) ? 1 : 0 );
+
+    ( $_[0] < 0 ) ?
+      -1 :
+      (
+        ( $_[0] > 0 ) ? 1 : 0 );
+
 ==> b156 <==
 # State 1
 {
index 43d7b8b97e67c9e229019d93f4b78351ded5e42a..d1434be459a40642474906dd6ab1b6d74c55b812 100644 (file)
@@ -39072,6 +39072,14 @@ sub examine_vertical_tightness_flags {
     return;
 } ## end sub examine_vertical_tightness_flags
 
+my %is_uncovered_operator;
+
+# b1060, b1499
+BEGIN {
+    my @q = qw( ? : && || );
+    @is_uncovered_operator{@q} = (1) x scalar(@q);
+}
+
 sub set_vertical_tightness_flags {
 
     my (
@@ -39430,7 +39438,9 @@ sub set_vertical_tightness_flags {
 
             # Fix for case b1060 when both -baoo and -otr are set:
             # to avoid blinking, honor the -baoo flag over the -otr flag.
-            && $token_end ne '||' && $token_end ne '&&'
+            # b1499 added ? and : for same reason
+            ##&& $token_end ne '||' && $token_end ne '&&'
+            && !$is_uncovered_operator{$token_end}
 
             # Keep break after '=' if -lp. Fixes b964 b1040 b1062 b1083 b1089.
             # Generalized from '=' to $is_assignment to fix b1375.