From 16b4575e90c91328f767f7dd4d5c785cc0190405 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 9 Aug 2021 09:26:03 -0700 Subject: [PATCH] Fix formatting instability, b1191 --- dev-bin/run_convergence_tests.pl.data | 25 +++++++++++++++++++++++++ lib/Perl/Tidy/Formatter.pm | 2 ++ local-docs/BugLog.pod | 14 ++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index f4fcad3a..fc38ffa3 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -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 diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index a174cc1e..c49060b0 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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; diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index a22ccf4b..46aad0d3 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,20 @@ =over 4 +=item B + +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 Testing with random parameters produced an instability which was caused -- 2.39.5