}
==> b1378.par <==
--extrude -vtc=2 -dtc=1
+-extrude -vtc=2 -dtc -tcs=0
+
+==> b1379.in <==
+# S1
+print star (
+ 'Sol',
+ planet (
+ 'Earth', moon ('Lunar')
+ ), );
+
+# S2
+print star (
+ 'Sol',
+ planet (
+ 'Earth', moon ('Lunar'), )
+);
+
+
+==> b1379.par <==
+--add-trailing-commas
+--delete-trailing-commas
+--extended-line-up-parentheses
+--ignore-old-breakpoints
+--indent-columns=3
+--maximum-fields-per-table=27
+--maximum-line-length=40
+--space-function-paren
+--trailing-comma-style='b'
+--variable-maximum-line-length
+--vertical-tightness-closing=2
==> b140.in <==
$cmd[ $i ]=[
_roverride_cab3_ => $i++,
_ris_assigned_structure_ => $i++,
_ris_short_broken_eval_block_ => $i++,
+ _ris_bare_trailing_comma_by_seqno_ => $i++,
_rseqno_non_indenting_brace_by_ix_ => $i++,
_rreduce_vertical_tightness_by_seqno_ => $i++,
$self->[_roverride_cab3_] = {};
$self->[_ris_assigned_structure_] = {};
$self->[_ris_short_broken_eval_block_] = {};
+ $self->[_ris_bare_trailing_comma_by_seqno_] = {};
$self->[_rseqno_non_indenting_brace_by_ix_] = {};
$self->[_rreduce_vertical_tightness_by_seqno_] = {};
# if -dtc set => will delete non-bare trailing commas
# =h or 'hash': single column stable bare lists require trailing comma
# if -atc set will add these
- # TODO: currently only works with -atc
+ # if -dtc set will delete other trailing commas
my $rvalid_flags = [qw(0 1 * m b h)];
$rLL_new );
}
+ # Fix for b1379, b1380, part 1. Mark bare trailing commas for use by -vtc
+ # logic to avoid instability when -dtc and -atc are both active.
+ if ( $match
+ && ( $trailing_comma_style eq 'b' || $trailing_comma_style eq 'h' ) )
+ {
+ if ( $if_add && $rOpts_delete_trailing_commas
+ || !$if_add && $rOpts_add_trailing_commas )
+ {
+ $self->[_ris_bare_trailing_comma_by_seqno_]->{$type_sequence} = 1;
+ }
+ }
+
return $match;
}
$cvt = 1;
}
+ # Fix for b1379, b1380, part 2. In some rare cases, -cvt=2 can be
+ # unstable with adding and deleting trailing bare commas.
+ # Reducing to -cvt=1 seems to restore stability.
+ if ( $cvt == 2
+ && $self->[_ris_bare_trailing_comma_by_seqno_]->{$seqno} )
+ {
+ $cvt = 1;
+ }
+
if (
# Never append a trailing line like ')->pack(' because it