]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix b1502
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 22 Dec 2024 23:40:59 +0000 (15:40 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 22 Dec 2024 23:40:59 +0000 (15:40 -0800)
dev-bin/run_convergence_tests.pl.data
dev-bin/run_convergence_tests.pl.expect
lib/Perl/Tidy/Formatter.pm

index 82b85529aceaa9f631619646b0299d65c128702b..3dcab195dafe1c59f76b9aa303a58bc470ee4cd6 100644 (file)
@@ -12534,6 +12534,24 @@ my%S3d_url=(
 --noadd-whitespace
 --extended-line-up-parentheses
 
+==> b1502.in <==
+my $species =
+        new Bio::Species(
+    -classification =>
+            [ qw(
+        sapiens Homo Hominidae Catarrhini Primates Eutheria
+        Mammalia Vertebrata Chordata Metazoa Eukaryota
+            ) ]
+        );
+
+==> b1502.par <==
+--maximum-line-length=29
+--continuation-indentation=8
+--line-up-parentheses
+--weld-nested-containers
+--stack-opening-paren
+--stack-closing-square-bracket
+
 ==> b156.in <==
 # State 1
 {
index 9f4fd7e8114d024d09dacca7c1a63006d58531f1..a7f4a760ad8d23259daa4d03c4ead10e0e0832b6 100644 (file)
@@ -8489,6 +8489,15 @@ my%S3d_url=(
      .'pdb_neighbors?id=CHAIN&gene=ORF_NAME'
 );
 
+==> b1502 <==
+my $species =
+        new Bio::Species(
+    -classification => [ qw(
+                sapiens Homo Hominidae Catarrhini Primates Eutheria
+                Mammalia Vertebrata Chordata Metazoa Eukaryota
+        ) ]
+        );
+
 ==> b156 <==
 # State 1
 {
index 8e3f48e7d580075800cf3cb69f34f501dd74abdd..797987264fb1fcc13b19a1c2f61ec1397fcbb5cd 100644 (file)
@@ -20712,6 +20712,10 @@ sub weld_nested_quotes {
         # look bad.
         next if ( $Kinner_closing == $Kinner_opening );
 
+        # RULE: Avoid welding under stress. Fixes b1502.
+        my $inner_level = $rLL->[$Kinner_opening]->[_LEVEL_];
+        if ( $inner_level >= $high_stress_level ) { next }
+
         # Only weld to quotes delimited with container tokens. This is
         # because welding to arbitrary quote delimiters can produce code
         # which is less readable than without welding.