From a34be560b637a40cfb5a932906104b47d7f9ab65 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 21 Sep 2020 18:44:11 -0700 Subject: [PATCH] removed unused sub link_sequence_items --- lib/Perl/Tidy/Formatter.pm | 75 -------------------------------------- 1 file changed, 75 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index bab61440..014fc63f 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -4885,81 +4885,6 @@ sub bli_adjustment { return; } -sub link_sequence_items { - - # This has been merged into 'respace_tokens' but retained for reference - my $self = shift; - my $rlines = $self->[_rlines_]; - my $rLL = $self->[_rLL_]; - - # We walk the token list and make links to the next sequence item. - # We also define these hashes to container tokens using sequence number as - # the key: - my $K_opening_container = {}; # opening [ { or ( - my $K_closing_container = {}; # closing ] } or ) - my $K_opening_ternary = {}; # opening ? of ternary - my $K_closing_ternary = {}; # closing : of ternary - - # sub to link preceding nodes forward to a new node type - my $link_back = sub { - my ( $Ktop, $key ) = @_; - - my $Kprev = $Ktop - 1; - while ( $Kprev >= 0 - && !defined( $rLL->[$Kprev]->[$key] ) ) - { - $rLL->[$Kprev]->[$key] = $Ktop; - $Kprev -= 1; - } - }; - - for ( my $KK = 0 ; $KK < @{$rLL} ; $KK++ ) { - - $rLL->[$KK]->[_KNEXT_SEQ_ITEM_] = undef; - - my $type = $rLL->[$KK]->[_TYPE_]; - - next if ( $type eq 'b' ); - - my $type_sequence = $rLL->[$KK]->[_TYPE_SEQUENCE_]; - if ($type_sequence) { - - $link_back->( $KK, _KNEXT_SEQ_ITEM_ ); - - my $token = $rLL->[$KK]->[_TOKEN_]; - if ( $is_opening_token{$token} ) { - - $K_opening_container->{$type_sequence} = $KK; - } - elsif ( $is_closing_token{$token} ) { - - $K_closing_container->{$type_sequence} = $KK; - } - - # These are not yet used but could be useful - else { - if ( $token eq '?' ) { - $K_opening_ternary->{$type_sequence} = $KK; - } - elsif ( $token eq ':' ) { - $K_closing_ternary->{$type_sequence} = $KK; - } - else { - Fault(<[_K_opening_container_] = $K_opening_container; - $self->[_K_closing_container_] = $K_closing_container; - $self->[_K_opening_ternary_] = $K_opening_ternary; - $self->[_K_closing_ternary_] = $K_closing_ternary; - return; -} - sub resync_lines_and_tokens { my $self = shift; -- 2.39.5