]> git.donarmstrong.com Git - perltidy.git/commitdiff
remove unused modules LineBuffer, LineSink, LineSource
authorSteve Hancock <perltidy@users.sourceforge.net>
Wed, 26 Jul 2023 13:31:33 +0000 (06:31 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Wed, 26 Jul 2023 13:31:33 +0000 (06:31 -0700)
MANIFEST
dev-bin/build.pl
lib/Perl/Tidy/LineBuffer.pm [deleted file]
lib/Perl/Tidy/LineSink.pm [deleted file]
lib/Perl/Tidy/LineSource.pm [deleted file]
pm2pl

index b6683aa8c5ae1fb50c4197da8504449d1937b56a..0c4fc56e4ddb44344ac72a7b327d5d30c8ef29e0 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -45,9 +45,6 @@ lib/Perl/Tidy/HtmlWriter.pm
 lib/Perl/Tidy/IndentationItem.pm
 lib/Perl/Tidy/IOScalar.pm
 lib/Perl/Tidy/IOScalarArray.pm
-lib/Perl/Tidy/LineBuffer.pm
-lib/Perl/Tidy/LineSink.pm
-lib/Perl/Tidy/LineSource.pm
 lib/Perl/Tidy/Logger.pm
 lib/Perl/Tidy/Tokenizer.pm
 lib/Perl/Tidy/VerticalAligner.pm
index b3e6829ec07296cc3753d70133426e2a550cfab2..af3a1905714c3c591a796a0b2a2ef1586455de75 100755 (executable)
@@ -405,9 +405,6 @@ sub update_version_number {
       Tidy/IOScalar.pm
       Tidy/IOScalarArray.pm
       Tidy/IndentationItem.pm
-      Tidy/LineBuffer.pm
-      Tidy/LineSink.pm
-      Tidy/LineSource.pm
       Tidy/Logger.pm
       Tidy/Tokenizer.pm
       Tidy/VerticalAligner.pm
diff --git a/lib/Perl/Tidy/LineBuffer.pm b/lib/Perl/Tidy/LineBuffer.pm
deleted file mode 100644 (file)
index 5ffe854..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#####################################################################
-#
-# The Perl::Tidy::LineBuffer class supplies a 'get_line()'
-# method for returning the next line to be parsed, as well as a
-# 'peek_ahead()' method
-#
-# The input parameter is an object with a 'get_line()' method
-# which returns the next line to be parsed
-#
-#####################################################################
-
-package Perl::Tidy::LineBuffer;
-use strict;
-use warnings;
-our $VERSION = '20230701.01';
-
-sub AUTOLOAD {
-
-    # Catch any undefined sub calls so that we are sure to get
-    # some diagnostic information.  This sub should never be called
-    # except for a programming error.
-    our $AUTOLOAD;
-    return if ( $AUTOLOAD =~ /\bDESTROY$/ );
-    my ( $pkg, $fname, $lno ) = caller();
-    my $my_package = __PACKAGE__;
-    print STDERR <<EOM;
-======================================================================
-Error detected in package '$my_package', version $VERSION
-Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
-Called from File '$fname'  at line '$lno'
-This error is probably due to a recent programming change
-======================================================================
-EOM
-    exit 1;
-}
-
-sub DESTROY {
-
-    # required to avoid call to AUTOLOAD in some versions of perl
-}
-
-sub new {
-
-    my ( $class, $line_source_object ) = @_;
-
-    return bless {
-        _line_source_object => $line_source_object,
-        _rlookahead_buffer  => [],
-    }, $class;
-}
-
-sub peek_ahead {
-    my ( $self, $buffer_index ) = @_;
-    my $line               = undef;
-    my $line_source_object = $self->{_line_source_object};
-    my $rlookahead_buffer  = $self->{_rlookahead_buffer};
-    if ( $buffer_index < scalar( @{$rlookahead_buffer} ) ) {
-        $line = $rlookahead_buffer->[$buffer_index];
-    }
-    else {
-        $line = $line_source_object->get_line();
-        push( @{$rlookahead_buffer}, $line );
-    }
-    return $line;
-}
-
-sub get_line {
-    my $self               = shift;
-    my $line               = undef;
-    my $line_source_object = $self->{_line_source_object};
-    my $rlookahead_buffer  = $self->{_rlookahead_buffer};
-
-    if ( scalar( @{$rlookahead_buffer} ) ) {
-        $line = shift @{$rlookahead_buffer};
-    }
-    else {
-        $line = $line_source_object->get_line();
-    }
-    return $line;
-}
-1;
-
diff --git a/lib/Perl/Tidy/LineSink.pm b/lib/Perl/Tidy/LineSink.pm
deleted file mode 100644 (file)
index 4ca4396..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-#####################################################################
-#
-# the Perl::Tidy::LineSink class supplies a write_line method for
-# actual file writing
-#
-#####################################################################
-
-package Perl::Tidy::LineSink;
-use strict;
-use warnings;
-our $VERSION = '20230701.01';
-
-sub AUTOLOAD {
-
-    # Catch any undefined sub calls so that we are sure to get
-    # some diagnostic information.  This sub should never be called
-    # except for a programming error.
-    our $AUTOLOAD;
-    return if ( $AUTOLOAD =~ /\bDESTROY$/ );
-    my ( $pkg, $fname, $lno ) = caller();
-    my $my_package = __PACKAGE__;
-    print STDERR <<EOM;
-======================================================================
-Error detected in package '$my_package', version $VERSION
-Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
-Called from File '$fname'  at line '$lno'
-This error is probably due to a recent programming change
-======================================================================
-EOM
-    exit 1;
-}
-
-sub DESTROY {
-
-    # required to avoid call to AUTOLOAD in some versions of perl
-}
-
-sub new {
-
-    my ( $class, @args ) = @_;
-
-    my %defaults = (
-        output_file     => undef,
-        line_separator  => undef,
-        is_encoded_data => undef,
-    );
-    my %args = ( %defaults, @args );
-
-    my $output_file     = $args{output_file};
-    my $line_separator  = $args{line_separator};
-    my $is_encoded_data = $args{is_encoded_data};
-
-    my $fh = undef;
-
-    my $output_file_open = 0;
-
-    ( $fh, $output_file ) =
-      Perl::Tidy::streamhandle( $output_file, 'w', $is_encoded_data );
-    unless ($fh) { Perl::Tidy::Die("Cannot write to output stream\n"); }
-    $output_file_open = 1;
-
-    return bless {
-        _fh               => $fh,
-        _output_file      => $output_file,
-        _output_file_open => $output_file_open,
-        _line_separator   => $line_separator,
-        _is_encoded_data  => $is_encoded_data,
-    }, $class;
-}
-
-sub set_line_separator {
-    my ( $self, $val ) = @_;
-    $self->{_line_separator} = $val;
-    return;
-}
-
-sub write_line {
-
-    my ( $self, $line ) = @_;
-    my $fh = $self->{_fh};
-
-    my $line_separator = $self->{_line_separator};
-    if ( defined($line_separator) ) {
-        chomp $line;
-        $line .= $line_separator;
-    }
-
-    $fh->print($line) if ( $self->{_output_file_open} );
-
-    return;
-}
-
-sub close_output_file {
-    my $self = shift;
-
-    # Only close physical files, not STDOUT and other objects
-    my $output_file = $self->{_output_file};
-    if ( $output_file ne '-' && !ref $output_file ) {
-        $self->{_fh}->close() if $self->{_output_file_open};
-    }
-    return;
-}
-
-1;
diff --git a/lib/Perl/Tidy/LineSource.pm b/lib/Perl/Tidy/LineSource.pm
deleted file mode 100644 (file)
index 64ba88d..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-#####################################################################
-#
-# the Perl::Tidy::LineSource class supplies an object with a 'get_line()' method
-# which returns the next line to be parsed
-#
-#####################################################################
-
-package Perl::Tidy::LineSource;
-use strict;
-use warnings;
-use English qw( -no_match_vars );
-our $VERSION = '20230701.01';
-
-use constant DEVEL_MODE => 0;
-
-sub AUTOLOAD {
-
-    # Catch any undefined sub calls so that we are sure to get
-    # some diagnostic information.  This sub should never be called
-    # except for a programming error.
-    our $AUTOLOAD;
-    return if ( $AUTOLOAD =~ /\bDESTROY$/ );
-    my ( $pkg, $fname, $lno ) = caller();
-    my $my_package = __PACKAGE__;
-    print STDERR <<EOM;
-======================================================================
-Error detected in package '$my_package', version $VERSION
-Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
-Called from File '$fname'  at line '$lno'
-This error is probably due to a recent programming change
-======================================================================
-EOM
-    exit 1;
-}
-
-sub DESTROY {
-
-    # required to avoid call to AUTOLOAD in some versions of perl
-}
-
-sub new {
-
-    my ( $class, @args ) = @_;
-
-    my %defaults = (
-        input_file => undef,
-        rOpts      => undef,
-    );
-
-    my %args = ( %defaults, @args );
-
-    my $input_file = $args{input_file};
-    my $rOpts      = $args{rOpts};
-
-    ( my $fh, $input_file ) = Perl::Tidy::streamhandle( $input_file, 'r' );
-    return unless $fh;
-
-    return bless {
-        _fh            => $fh,
-        _filename      => $input_file,
-        _rinput_buffer => [],
-        _started       => 0,
-    }, $class;
-}
-
-sub close_input_file {
-    my $self = shift;
-
-    # Only close physical files, not STDIN and other objects
-    my $filename = $self->{_filename};
-    if ( $filename ne '-' && !ref $filename ) {
-        my $ok = eval { $self->{_fh}->close(); 1 };
-        if ( !$ok && DEVEL_MODE ) {
-            Fault("Could not close file handle(): $EVAL_ERROR\n");
-        }
-    }
-    return;
-}
-
-sub get_line {
-    my $self          = shift;
-    my $line          = undef;
-    my $fh            = $self->{_fh};
-    my $rinput_buffer = $self->{_rinput_buffer};
-
-    if ( scalar( @{$rinput_buffer} ) ) {
-        $line = shift @{$rinput_buffer};
-    }
-    else {
-        $line = $fh->getline();
-
-        # patch to read raw mac files under unix, dos
-        # see if the first line has embedded \r's
-        if ( defined($line) && !$self->{_started} ) {
-            if ( $line =~ /[\015][^\015\012]/ ) {
-
-                # found one -- break the line up and store in a buffer
-                @{$rinput_buffer} = map { $_ . "\n" } split /\015/, $line;
-                my $count = @{$rinput_buffer};
-                $line = shift @{$rinput_buffer};
-            }
-            $self->{_started}++;
-        }
-    }
-    return $line;
-}
-1;
diff --git a/pm2pl b/pm2pl
index 3e3af2c667d0c27869fc198701bbb543edfa8672..70e4c7b09677492eb8920cd33b29d154e522b4f1 100755 (executable)
--- a/pm2pl
+++ b/pm2pl
@@ -49,9 +49,6 @@ my @modules = qw(
   lib/Perl/Tidy/IOScalar.pm
   lib/Perl/Tidy/IOScalarArray.pm
   lib/Perl/Tidy/IndentationItem.pm
-  lib/Perl/Tidy/LineBuffer.pm
-  lib/Perl/Tidy/LineSink.pm
-  lib/Perl/Tidy/LineSource.pm
   lib/Perl/Tidy/Logger.pm
   lib/Perl/Tidy/Tokenizer.pm
   lib/Perl/Tidy/VerticalAligner.pm