# $_[0]->();
# } );
+ # Updated to fix cases b1082 b1102 b1106 b1115:
+ # Also, do not weld to an intact inner block if the outer opening token
+ # is on a different line. For example, this prevents oscillation
+ # between these two states in case b1106:
+
+ # return map{
+ # ($_,[$self->$_(@_[1..$#_])])
+ # }@every;
+
+ # return map { (
+ # $_, [ $self->$_( @_[ 1 .. $#_ ] ) ]
+ # ) } @every;
+
+ # The effect of this change on typical code is very minimal. Sometimes
+ # it may take a second iteration to converge, but this gives protection
+ # against blinking.
+
if ( !$do_not_weld_rule
&& !$is_one_line_weld
&& $iline_ic == $iline_io )
{
- $do_not_weld_rule = 2 if ( $token_oo eq '(' );
+ $do_not_weld_rule = 2
+ if ( $token_oo eq '(' || $iline_oo != $iline_io );
}
# DO-NOT-WELD RULE 3:
=over 4
+=item B<Update welding rule to avoid blinking states>
+
+Random testing with unusual parameter combinations produced some unstable welds.
+For example case b1106 has these parameters
+
+ --noadd-whitespace
+ --continuation-indentation=6
+ --delete-old-whitespace
+ --line-up-parentheses
+ --maximum-line-length=36
+ --variable-maximum-line-length
+ --weld-nested-containers
+
+and was switching between these two states:
+
+ return map{
+ ($_,[$self->$_(@_[1..$#_])])
+ }@every;
+
+ return map { (
+ $_, [ $self->$_( @_[ 1 .. $#_ ] ) ]
+ ) } @every;
+
+An existing rule, WELD RULE 2, was updated to prevent welding to an intact
+one-line weld, as in the first snippet, if it is on a separate line from the
+first opening token. With this change, both of these states are stable.
+
+This update fixes cases b1082 b1102 b1106 b1115.
+
+4 May 2021.
+
=item B<Fix problem of conflict of -otr and -lp>
Several random test cases produced an instability involving -otr and -lp.
# fixed RULE 1 only applies to '('
my $res = eval { { $die_on_fetch, 0 } };
- my $res = eval { { $die_on_fetch, 0 } };
+ my $res = eval {
+ { $die_on_fetch, 0 }
+ };
# fixed RULE 2 applies to any inner opening token; this is a stable
# state with -wn
../snippets24.t lpxl.lpxl5
../snippets24.t git63.def
../snippets24.t align35.def
+../snippets24.t rt136417.def
+../snippets24.t rt136417.rt136417
../snippets3.t ce_wn1.ce_wn
../snippets3.t ce_wn1.def
../snippets3.t colin.colin
../snippets9.t rt98902.def
../snippets9.t rt98902.rt98902
../snippets9.t rt99961.def
-../snippets24.t rt136417.def
-../snippets24.t rt136417.rt136417
# fixed RULE 1 only applies to '('
my $res = eval { { $die_on_fetch, 0 } };
- my $res = eval { { $die_on_fetch, 0 } };
+ my $res = eval {
+ { $die_on_fetch, 0 }
+ };
# fixed RULE 2 applies to any inner opening token; this is a stable
# state with -wn