if ( $next_nonblank_token =~ /^(die|confess|croak|warn)$/ ) {
if ( $want_break_before{$token} && $i > 0 ) {
$bond_strength_to_go[ $i - 1 ] -= $delta_bias;
+
+ # keep bond strength of a token and its following blank
+ # the same
+ if ( $types_to_go[ $i - 1 ] eq 'b' && $i > 2 ) {
+ $bond_strength_to_go[ $i - 2 ] -= $delta_bias;
+ }
}
else {
$bond_str -= $delta_bias;
#-------------------------------------------------------
# BEGINNING of inner loop to find the best next breakpoint
#-------------------------------------------------------
+ my $strength = NO_BREAK;
for ( $i_test = $i_begin ; $i_test <= $imax ; $i_test++ ) {
my $type = $types_to_go[$i_test];
my $token = $tokens_to_go[$i_test];
my $next_nonblank_type = $types_to_go[$i_next_nonblank];
my $next_nonblank_token = $tokens_to_go[$i_next_nonblank];
my $next_nonblank_block_type = $block_type_to_go[$i_next_nonblank];
- my $strength = $bond_strength_to_go[$i_test];
my $maximum_line_length = maximum_line_length($i_begin);
+ # adjustments to the previous bond strength may have been made, and
+ # we must keep the bond strength of a token and its following blank
+ # the same;
+ my $last_strength = $strength;
+ $strength = $bond_strength_to_go[$i_test];
+ if ( $type eq 'b' ) { $strength = $last_strength }
+
# use old breaks as a tie-breaker. For example to
# prevent blinkers with -pbp in this code:
--- /dev/null
+ # These formerly blinked with -pbp
+ return $width1 *
+ $common_length *
+ (
+ $W * atan2( 1, $W ) +
+ $H * atan2( 1, $H ) -
+ $RTHSQPWSQ * atan2( 1, $RTHSQPWSQ ) +
+ 0.25 * log(
+ ( $WSQP1 * $HSQP1 ) /
+ ( 1 + $WSQ + $HSQ ) *
+ ( $WSQ * ( 1 + $WSQ + $HSQ ) / ( $WSQP1 * $HSQPWSQ ) )
+ **$WSQ *
+ ( $HSQ * ( 1 + $WSQ + $HSQ ) / ( $HSQP1 * $HSQPWSQ ) )**$HSQ
+ )
+ ) /
+ ( $W * $pi );
+
+ my $oldSec =
+ ( 60 * $session->{originalStartHour} + $session->{originalStartMin} )
+ * 60;
+
--- /dev/null
+ # These formerly blinked with -pbp
+ return
+ $width1 * $common_length
+ * (
+ $W * atan2( 1, $W )
+ + $H * atan2( 1, $H )
+ - $RTHSQPWSQ * atan2( 1, $RTHSQPWSQ )
+ + 0.25 * log(
+ ( $WSQP1 * $HSQP1 )
+ / ( 1 + $WSQ + $HSQ )
+ * ( $WSQ * ( 1 + $WSQ + $HSQ ) / ( $WSQP1 * $HSQPWSQ ) )
+ **$WSQ
+ * ( $HSQ * ( 1 + $WSQ + $HSQ ) / ( $HSQP1 * $HSQPWSQ ) )
+ **$HSQ
+ )
+ )
+ / ( $W * $pi );
+
+ my $oldSec
+ = ( 60 * $session->{originalStartHour}
+ + $session->{originalStartMin} )
+ * 60;
+
../snippets17.t rperl.rperl
../snippets17.t wn7.def
../snippets17.t wn7.wn
+../snippets17.t wn8.def
+../snippets17.t wn8.wn
../snippets2.t angle.def
../snippets2.t arrows1.def
../snippets2.t arrows2.def
../snippets9.t rt98902.def
../snippets9.t rt98902.rt98902
../snippets9.t rt99961.def
-../snippets17.t wn8.def
-../snippets17.t wn8.wn
+../snippets17.t pbp6.def
+../snippets17.t pbp6.pbp
--- /dev/null
+ # These formerly blinked with -pbp
+ return $width1*$common_length*(
+ $W*atan2(1,$W)
+ + $H*atan2(1,$H)
+ - $RTHSQPWSQ*atan2(1,$RTHSQPWSQ)
+ + 0.25*log(
+ ($WSQP1*$HSQP1)/(1+$WSQ+$HSQ)
+ *($WSQ*(1+$WSQ+$HSQ)/($WSQP1*$HSQPWSQ))**$WSQ
+ *($HSQ*(1+$WSQ+$HSQ)/($HSQP1*$HSQPWSQ))**$HSQ
+ )
+ )/($W*$pi);
+
+ my $oldSec = ( 60 * $session->{originalStartHour} + $session->{originalStartMin} ) * 60;
+
#7 wn7.wn
#8 wn8.def
#9 wn8.wn
+#10 pbp6.def
+#11 pbp6.pbp
# To locate test #13 you can search for its name or the string '#13'
###########################################
$rparams = {
'def' => "",
+ 'pbp' => "-pbp -nst -nse",
'rperl' => "-l=0",
'rt132059' => "-dac",
'wn' => "-wn",
############################
$rsources = {
+ 'pbp6' => <<'----------',
+ # These formerly blinked with -pbp
+ return $width1*$common_length*(
+ $W*atan2(1,$W)
+ + $H*atan2(1,$H)
+ - $RTHSQPWSQ*atan2(1,$RTHSQPWSQ)
+ + 0.25*log(
+ ($WSQP1*$HSQP1)/(1+$WSQ+$HSQ)
+ *($WSQ*(1+$WSQ+$HSQ)/($WSQP1*$HSQPWSQ))**$WSQ
+ *($HSQ*(1+$WSQ+$HSQ)/($HSQP1*$HSQPWSQ))**$HSQ
+ )
+ )/($W*$pi);
+
+ my $oldSec = ( 60 * $session->{originalStartHour} + $session->{originalStartMin} ) * 60;
+
+----------
+
'rperl' => <<'----------',
# Some test cases for RPerl, https://github.com/wbraswell/rperl/
# These must not remain as single lines with default formatting and long lines
);
#9...........
},
+
+ 'pbp6.def' => {
+ source => "pbp6",
+ params => "def",
+ expect => <<'#10...........',
+ # These formerly blinked with -pbp
+ return $width1 *
+ $common_length *
+ (
+ $W * atan2( 1, $W ) +
+ $H * atan2( 1, $H ) -
+ $RTHSQPWSQ * atan2( 1, $RTHSQPWSQ ) +
+ 0.25 * log(
+ ( $WSQP1 * $HSQP1 ) /
+ ( 1 + $WSQ + $HSQ ) *
+ ( $WSQ * ( 1 + $WSQ + $HSQ ) / ( $WSQP1 * $HSQPWSQ ) )
+ **$WSQ *
+ ( $HSQ * ( 1 + $WSQ + $HSQ ) / ( $HSQP1 * $HSQPWSQ ) )**$HSQ
+ )
+ ) /
+ ( $W * $pi );
+
+ my $oldSec =
+ ( 60 * $session->{originalStartHour} + $session->{originalStartMin} )
+ * 60;
+
+#10...........
+ },
+
+ 'pbp6.pbp' => {
+ source => "pbp6",
+ params => "pbp",
+ expect => <<'#11...........',
+ # These formerly blinked with -pbp
+ return
+ $width1 * $common_length
+ * (
+ $W * atan2( 1, $W )
+ + $H * atan2( 1, $H )
+ - $RTHSQPWSQ * atan2( 1, $RTHSQPWSQ )
+ + 0.25 * log(
+ ( $WSQP1 * $HSQP1 )
+ / ( 1 + $WSQ + $HSQ )
+ * ( $WSQ * ( 1 + $WSQ + $HSQ ) / ( $WSQP1 * $HSQPWSQ ) )
+ **$WSQ
+ * ( $HSQ * ( 1 + $WSQ + $HSQ ) / ( $HSQP1 * $HSQPWSQ ) )
+ **$HSQ
+ )
+ )
+ / ( $W * $pi );
+
+ my $oldSec
+ = ( 60 * $session->{originalStartHour}
+ + $session->{originalStartMin} )
+ * 60;
+
+#11...........
+ },
};
my $ntests = 0 + keys %{$rtests};