]> git.donarmstrong.com Git - perltidy.git/commitdiff
Fix formatting instability, b1191
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 9 Aug 2021 16:26:03 +0000 (09:26 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 9 Aug 2021 16:26:03 +0000 (09:26 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm
local-docs/BugLog.pod

index f4fcad3a569ac44d13cf5bccef4306364d5c6b1f..fc38ffa3e40264ee3396fef581cef7c491cd79f7 100644 (file)
@@ -7096,6 +7096,31 @@ print
 --opening-anonymous-sub-brace-on-new-line
 --variable-maximum-line-length
 
+==> b1191.in <==
+# S1
+    $_[0]eq$_[1]
+      or($_[1]=~/^([!~])(.)([\x00-\xff]*)/)
+      and($1 eq '!')
+      ^(eval{($_[2]."::".$_[0])=~/$2$3/;});
+
+# S2
+
+    $_[0]eq$_[1]
+      or($_[1]=~/^([!~])(.)([\x00-\xff]*)/)
+      and($1 eq '!')^(
+        eval{
+            ($_[2]."::".$_[0])=~/$2$3/;
+        }
+      );
+
+
+==> b1191.par <==
+--noadd-whitespace
+--line-up-parentheses
+--maximum-line-length=48
+--paren-vertical-tightness=1
+--weld-nested-containers
+
 ==> b120.in <==
 # Same as bug96
 # State 1
index a174cc1ee9306b30ed15512123d0a14023295854..c49060b0dc7cfaa22d7b6eff40d29ac2cdcedfe9 100644 (file)
@@ -8052,9 +8052,11 @@ EOM
                     # If an apparent one-line weld might have been created by
                     # -vt and -lp, then do not mark as a one-line weld.
                     # This condition added to fix b1183.
+                    # Added block type test to fix b1191
                     if (   $is_one_line_weld
                         && $rOpts_line_up_parentheses
                         && $opening_vertical_tightness{$token_oo}
+                        && !$rblock_type_of_seqno->{$inner_seqno}
                         && !$ris_excluded_lp_container->{$outer_seqno} )
                     {
                         $is_one_line_weld = 0;
index a22ccf4b0be786154fef45623b222351005f5e25..46aad0d327be811c768e6a8036e31ff94130c89f 100644 (file)
@@ -2,6 +2,20 @@
 
 =over 4
 
+=item B<Fix formatting instability, b1191>
+
+Random testing produced an instability involving an unusual parameter
+combination and the following input code:
+
+    $_[0]eq$_[1]
+      or($_[1]=~/^([!~])(.)([\x00-\xff]*)/)
+      and($1 eq '!')
+      ^(eval{($_[2]."::".$_[0])=~/$2$3/;});
+
+This update fixes case b1191.
+
+9 Aug 2021.
+
 =item B<Fix error parsing sub attributes without spaces, b1190>
 
 Testing with random parameters produced an instability which was caused