_rcollapsed_length_by_seqno_ => $i++,
_rbreak_before_container_by_seqno_ => $i++,
- _ris_essential_old_breakpoint_ => $i++,
_roverride_cab3_ => $i++,
_ris_assigned_structure_ => $i++,
_ris_short_broken_eval_block_ => $i++,
$self->[_rcollapsed_length_by_seqno_] = {};
$self->[_rbreak_before_container_by_seqno_] = {};
- $self->[_ris_essential_old_breakpoint_] = {};
$self->[_roverride_cab3_] = {};
$self->[_ris_assigned_structure_] = {};
$self->[_ris_short_broken_eval_block_] = {};
my $file_writer_object = $self->[_file_writer_object_];
$file_writer_object->setup_convergence_test( \@Klast_valign_code );
- # Mark essential old breakpoints if combination -iob -lp is used. These
- # two options do not work well together, but we can avoid turning -iob off
- # by ignoring -iob at certain essential line breaks.
- # Fixes cases b1021 b1023 b1034 b1048 b1049 b1050 b1056 b1058
- if ( $rOpts_ignore_old_breakpoints && $rOpts_line_up_parentheses ) {
- my %is_assignment_or_fat_comma = %is_assignment;
- $is_assignment_or_fat_comma{'=>'} = 1;
- my $ris_essential_old_breakpoint =
- $self->[_ris_essential_old_breakpoint_];
- my ( $Kfirst, $Klast );
- foreach my $line_of_tokens ( @{$rlines} ) {
- my $line_type = $line_of_tokens->{_line_type};
- if ( $line_type ne 'CODE' ) {
- ( $Kfirst, $Klast ) = ( undef, undef );
- next;
- }
- my ( $Kfirst_prev, $Klast_prev ) = ( $Kfirst, $Klast );
- ( $Kfirst, $Klast ) = @{ $line_of_tokens->{_rK_range} };
-
- next unless defined($Klast_prev);
- next unless defined($Kfirst);
- my $type_last = $rLL->[$Klast_prev]->[_TOKEN_];
- my $type_first = $rLL->[$Kfirst]->[_TOKEN_];
- next
- unless ( $is_assignment_or_fat_comma{$type_last}
- || $is_assignment_or_fat_comma{$type_first} );
- $ris_essential_old_breakpoint->{$Klast_prev} = 1;
- }
- }
return ( $severe_error, $rqw_lines );
+
} ## end sub resync_lines_and_tokens
sub check_for_old_break {
return;
} ## end sub flush
+ my %is_assignment_or_fat_comma;
+
+ BEGIN {
+ %is_assignment_or_fat_comma = %is_assignment;
+ $is_assignment_or_fat_comma{'=>'} = 1;
+ }
+
sub process_line_of_CODE {
my ( $self, $my_line_of_tokens ) = @_;
# This is a good place to kill incomplete one-line blocks
if ( $max_index_to_go >= 0 ) {
+
+ # For -iob and -lp, mark essential old breakpoints.
+ # Fixes b1021 b1023 b1034 b1048 b1049 b1050 b1056 b1058
+ # See related code below.
+ if ( $rOpts_ignore_old_breakpoints && $rOpts_line_up_parentheses ) {
+ my $type_first = $rLL->[$K_first_true]->[_TYPE_];
+ if ( $is_assignment_or_fat_comma{$type_first} ) {
+ $old_breakpoint_to_go[$max_index_to_go] = 1;
+ }
+ }
+
if (
# this check needed -mangle (for example rt125012)
}
# mark old line breakpoints in current output stream
- if ( !$rOpts_ignore_old_breakpoints
- || $self->[_ris_essential_old_breakpoint_]->{$K_last} )
+ if (
+ !$rOpts_ignore_old_breakpoints
+
+ # Mark essential old breakpoints if combination -iob -lp is
+ # used. These two options do not work well together, but
+ # we can avoid turning -iob off by ignoring -iob at certain
+ # essential line breaks. See also related code above.
+ # Fixes b1021 b1023 b1034 b1048 b1049 b1050 b1056 b1058
+ || ( $rOpts_line_up_parentheses
+ && $is_assignment_or_fat_comma{$type} )
+ )
{
my $jobp = $max_index_to_go;
if ( $types_to_go[$max_index_to_go] eq 'b'