my $rbond_strength_to_go = [];
- my $rK_weld_right = $self->[_rK_weld_right_];
- my $rK_weld_left = $self->[_rK_weld_left_];
+ my $rLL = $self->[_rLL_];
+ my $rK_weld_right = $self->[_rK_weld_right_];
+ my $rK_weld_left = $self->[_rK_weld_left_];
+ my $ris_list_by_seqno = $self->[_ris_list_by_seqno_];
# patch-its always ok to break at end of line
$nobreak_to_go[$max_index_to_go] = 0;
# this will cause good preceding breaks to be retained
if ( $i_next_nonblank > $max_index_to_go ) {
$bsl = NOMINAL;
+
+ # But weaken the bond at a 'missing terminal comma'. If an
+ # optional comma is missing at the end of a broken list, use
+ # the strength of a comma anyway to make formatting the same as
+ # if it were there. Fixes issue c133.
+ if ( !defined($bsr) || $bsr > VERY_WEAK ) {
+ my $seqno = $parent_seqno_to_go[$max_index_to_go];
+ if ( $ris_list_by_seqno->{$seqno} ) {
+ my $KK = $K_to_go[$max_index_to_go];
+ my $Kn = $self->K_next_nonblank($KK);
+ my $seqno_n = $rLL->[$Kn]->[_TYPE_SEQUENCE_];
+ if ( $seqno_n && $seqno_n eq $seqno ) {
+ $bsl = VERY_WEAK;
+ }
+ }
+ }
}
# define right bond strengths of certain keywords
--- /dev/null
+# this will make 1 line unless -boc is used
+return (
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a)
+);
+
+# broken list - issue c133
+return (
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a)
+
+);
+
+# no parens
+return
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a);
--- /dev/null
+# this will make 1 line unless -boc is used
+return (
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a)
+);
+
+# broken list - issue c133
+return (
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a)
+
+);
+
+# no parens
+return
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a);
--- /dev/null
+# this will make 1 line unless -boc is used
+return ( $x * cos($a) - $y * sin($a), $x * sin($a) + $y * cos($a) );
+
+# broken list - issue c133
+return (
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a)
+
+);
+
+# no parens
+return
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a);
../snippets25.t bal.bal1
../snippets26.t bal.bal2
../snippets26.t bal.def
+../snippets26.t lpxl.lpxl6
../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
-../snippets26.t lpxl.lpxl6
+../snippets26.t c133.c133
+../snippets26.t c133.def
#1 bal.bal2
#2 bal.def
#3 lpxl.lpxl6
+#4 c133.c133
+#5 c133.def
# To locate test #13 you can search for its name or the string '#13'
###########################################
$rparams = {
'bal2' => "-bal=2",
+ 'c133' => "-boc",
'def' => "",
'lpxl6' => <<'----------',
# equivalent to -lpxl='{ [ F(2'
};
----------
+ 'c133' => <<'----------',
+# this will make 1 line unless -boc is used
+return (
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a)
+);
+
+# broken list - issue c133
+return (
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a)
+
+);
+
+# no parens
+return
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a);
+----------
+
'lpxl' => <<'----------',
# simple function call
my $loanlength = getLoanLength(
};
#3...........
},
+
+ 'c133.c133' => {
+ source => "c133",
+ params => "c133",
+ expect => <<'#4...........',
+# this will make 1 line unless -boc is used
+return (
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a)
+);
+
+# broken list - issue c133
+return (
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a)
+
+);
+
+# no parens
+return
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a);
+#4...........
+ },
+
+ 'c133.def' => {
+ source => "c133",
+ params => "def",
+ expect => <<'#5...........',
+# this will make 1 line unless -boc is used
+return ( $x * cos($a) - $y * sin($a), $x * sin($a) + $y * cos($a) );
+
+# broken list - issue c133
+return (
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a)
+
+);
+
+# no parens
+return
+ $x * cos($a) - $y * sin($a),
+ $x * sin($a) + $y * cos($a);
+#5...........
+ },
};
my $ntests = 0 + keys %{$rtests};