} ## end if ( $old_breakpoint_to_go...)
next if ( $type eq 'b' );
+
$depth = $nesting_depth_to_go[ $i + 1 ];
$total_depth_variation += abs( $depth - $depth_last );
#print "LISTX sees: i=$i type=$type tok=$token block=$block_type depth=$depth\n";
- #------------------------------------------------------------
+ #--------------------------
# Handle Increasing Depth..
- #
- # prepare for a new list when depth increases
- # token $i is a '(','{', or '['
- #------------------------------------------------------------
+ #--------------------------
+
# hardened against bad input syntax: depth jump must be 1 and type
# must be opening..fixes c102
if ( $depth == $current_depth + 1 && $is_opening_type{$type} ) {
} ## end if ( $depth > $current_depth)
- #------------------------------------------------------------
+ #--------------------------
# Handle Decreasing Depth..
- #
- # finish off any old list when depth decreases
- # token $i is a ')','}', or ']'
- #------------------------------------------------------------
+ #--------------------------
+
# hardened against bad input syntax: depth jump must be 1 and type
# must be closing .. fixes c102
elsif ( $depth == $current_depth - 1 && $is_closing_type{$type} ) {
} ## end elsif ( $depth < $current_depth)
- #------------------------------------------------------------
+ #------------------
# Handle this token
- #------------------------------------------------------------
+ #------------------
$current_depth = $depth;
}
} ## end while ( ++$i <= $max_index_to_go)
- #-------------------------------------------
+ #------------------------------------------
# end of loop over all tokens in this batch
- #-------------------------------------------
+ #------------------------------------------
# set breaks for any unfinished lists ..
foreach my $dd ( reverse( $minimum_depth .. $current_depth ) ) {
my ($self) = @_;
+ #--------------------------------------------
+ # prepare for a new list when depth increases
+ # token $i is a '(','{', or '['
+ #--------------------------------------------
+
#----------------------------------------------------------
# BEGIN initialize depth arrays
# ... use the same order as sub check_for_new_minimum_depth
$has_broken_sublist[$depth] = 0;
$want_comma_break[$depth] = 0;
- #-------------------------------------
+ #----------------------------
# END initialize depth arrays
- #-------------------------------------
+ #----------------------------
# patch to outdent opening brace of long if/for/..
# statements (like this one). See similar coding in
} ## end if ( $block_type && ( ...))
return;
- }
+ } ## end sub break_lists_increase_depth
sub break_lists_decrease_depth {
my ( $self, $rbond_strength_bias ) = @_;
- $self->check_for_new_minimum_depth( $depth, $parent_seqno_to_go[$i] );
+ # finish off any old list when depth decreases
+ # token $i is a ')','}', or ']'
- ##$comma_follows_last_closing_token =
- ## $next_nonblank_type eq ',' || $next_nonblank_type eq '=>';
+ $self->check_for_new_minimum_depth( $depth, $parent_seqno_to_go[$i] );
# force all outer logical containers to break after we see on
# old breakpoint
} ## end elsif ($is_long_term)
return;
- }
+ } ## end sub break_lists_decrease_depth
} ## end closure break_lists
my %is_kwiZ;