return ( $severe_error, $rqw_lines );
} ## end sub resync_lines_and_tokens
-sub check_for_break {
+sub check_for_old_break {
my ( $self, $KK, $rkeep_break_hash, $rbreak_hash ) = @_;
# This sub is called to help implement flags:
foreach my $item ( @{$rKrange_code_without_comments} ) {
my ( $Kfirst, $Klast ) = @{$item};
- $self->check_for_break( $Kfirst, \%keep_break_before_type,
+ $self->check_for_old_break( $Kfirst, \%keep_break_before_type,
$rbreak_before_Kfirst );
- $self->check_for_break( $Klast, \%keep_break_after_type,
+ $self->check_for_old_break( $Klast, \%keep_break_after_type,
$rbreak_after_Klast );
}
return;
# Loop over all sub-sections. Note that we have to work backwards
# from the end of the batch since the sections use original line
# numbers, and the line numbers change as we go.
- OUTER_LOOP:
while ( my $section = pop @{$rsections} ) {
my ( $nbeg, $nend ) = @{$section};
while ($more_to_do) {
- # Safety check for excess total iterations
+ # Emergency return on excess total iterations. The allowed
+ # maximum is large enough that this should never happen.
$it_count++;
if ( $it_count > $it_count_max ) {
- last OUTER_LOOP;
+ DEVEL_MODE && Fault(<<EOM);
+iteration count=$it_count exceeds max=$it_count_max
+EOM
+ goto RETURN;
}
my $n_best = 0;
);
}
$more_to_do = 0;
- last;
+ goto RETURN;
}
$nmax_last = $nmax;
$more_to_do = 0;
} # end loop over sections
+ RETURN:
+
if (DEBUG_RECOMBINE) {
my $nmax_last = @{$ri_end} - 1;
print STDERR
#-------------------------------------------------------
# Begin INNER_LOOP over the indexes in the _to_go arrays
#-------------------------------------------------------
- INNER_LOOP:
while ( ++$i_test <= $imax ) {
my $type = $types_to_go[$i_test];
my $token = $tokens_to_go[$i_test];
DEBUG_BREAK_LINES && do {
$Msg .= " :quit at good terminal='$next_nonblank_type'";
};
- last INNER_LOOP;
+ last;
}
}
$Msg .=
" :last at leading_alignment='$leading_alignment_type'";
};
- last INNER_LOOP;
+ last;
}
# Force at least one breakpoint if old code had good
DEBUG_BREAK_LINES && do {
$Msg .= " :last at good old break\n";
};
- last INNER_LOOP;
+ last;
}
# Do not skip past an important break point in a short final
DEBUG_BREAK_LINES && do {
$Msg .= " :last-noskip_short";
};
- last INNER_LOOP;
+ last;
}
}
DEBUG_BREAK_LINES && do {
$Msg .= " :last-must_break";
};
- last INNER_LOOP;
+ last;
}
# set flags to remember if a break here will produce a
#-----------------------------------------------------------
# Quit if there are no more tokens to test
- last INNER_LOOP if ( $i_test >= $imax );
+ last if ( $i_test >= $imax );
# Keep going if we have not reached the limit
my $excess =
$maximum_line_length;
if ( $excess < 0 ) {
- next INNER_LOOP;
+ next;
}
elsif ( $excess == 0 ) {
}
}
else {
- next INNER_LOOP;
+ next;
}
}
else {
DEBUG_BREAK_LINES && do {
$Msg .= " :do_not_strand next='$next_nonblank_type'";
};
- next INNER_LOOP;
+ next;
}
# Stop if here if we have a solution and the line will be too long
$Msg .=
" :Done-too_long && i_lowest=$i_lowest at itest=$i_test, imax=$imax";
};
- last INNER_LOOP;
+ last;
}
}