]> git.donarmstrong.com Git - perltidy.git/commitdiff
disallow kbb='(' - can cause math formatting instability
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 29 May 2022 14:15:39 +0000 (07:15 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 29 May 2022 14:15:39 +0000 (07:15 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm

index 26abfd7f28ddc662280dd897db8abfa2b6492435..0eda899493fd92340ccffe511a8b69ef1bde2431 100644 (file)
@@ -9880,6 +9880,46 @@ print to_json({success => $success ? 1 : 0});
 --variable-maximum-line-length
 --weld-nested-containers
 
+==> b1346.in <==
+        return (
+            $s + $t - $a / 3,
+            -0.5 * ( $s + $t ) +
+                  sqrt(-1) * sqrt(3) / 2 *
+                  ( $s - $t ) -
+                  ( $a / 3 ),
+            -0.5 * ( $s + $t ) -
+                  sqrt(-1) *
+                  sqrt(3) / 2 *
+                  ( $s - $t ) - ( $a / 3 )
+        );
+
+        return (
+            $s + $t - $a / 3,
+            -0.5 * ( $s + $t ) + sqrt(-1) * sqrt(3) / 2 *
+                  ( $s - $t ) -
+                  ( $a / 3 ),
+            -0.5 * ( $s + $t ) - sqrt(-1) * sqrt(3) / 2 *
+                  ( $s - $t ) - ( $a / 3 )
+        );
+
+
+        return (
+            $s + $t - $a / 3,
+            -0.5 * ( $s + $t ) +
+                  sqrt(-1) * sqrt(3) / 2 *
+                  ( $s - $t ) -
+                  ( $a / 3 ),
+            -0.5 * ( $s + $t ) -
+                  sqrt(-1) * sqrt(3) / 2 *
+                  ( $s - $t ) - ( $a / 3 )
+        );
+
+==> b1346.par <==
+--keep-old-breakpoints-before=' n ( '
+--continuation-indentation=6
+--maximum-line-length=60
+--extended-continuation-indentation
+
 ==> b140.in <==
 $cmd[ $i ]=[
         $s, $e, $cmd, \@hunk, $i ] ;
index 5933fd19c0cff38c07d00dc3893d2002c990e584..597938ecc08b66dbf20d4775f8a55a11cb9c32ab 100644 (file)
@@ -2305,6 +2305,11 @@ list is: @list;
 EOM
     }
 
+    # ignore kbb='(' : can cause unstable math formatting (issue b1346)
+    if ( $short_name eq 'kbb' ) {
+        @list = grep { $_ !~ /\(/ } @list;
+    }
+
     # pull out any any leading container code, like f( or *{
     # For example: 'f(' becomes flags hash entry '(' => 'f'
     foreach my $item (@list) {