# Perltidy Change Log
-## 2020 10 01.01
+## 2020 10 01.02
- Add flag -xci, --extended-continuation-indentation, regarding issue git #28
=head1 VERSION
-This man page documents perltidy version 20201001.01
+This man page documents perltidy version 20201001.02
=head1 BUG REPORTS
# Release version must be bumped, and it is probably past time for a
# release anyway.
- $VERSION = '20201001.01';
+ $VERSION = '20201001.02';
}
sub DESTROY {
=head1 VERSION
-This man page documents Perl::Tidy version 20201001.01
+This man page documents Perl::Tidy version 20201001.02
=head1 LICENSE
package Perl::Tidy::Debugger;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
sub new {
package Perl::Tidy::DevNull;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
sub new { my $self = shift; return bless {}, $self }
sub print { return }
sub close { return }
package Perl::Tidy::Diagnostics;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
sub AUTOLOAD {
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================
package Perl::Tidy::FileWriter;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
sub AUTOLOAD {
{ #<<< A non-indenting brace to contain all lexical variables
use Carp;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
# The Tokenizer will be loaded with the Formatter
##use Perl::Tidy::Tokenizer; # for is_keyword()
my $KK = $KNEXT;
$KNEXT = $rLL->[$KNEXT]->[_KNEXT_SEQ_ITEM_];
+ my $seqno = $rLL->[$KK]->[_TYPE_SEQUENCE_];
+ my $K_opening = $K_opening_container->{$seqno};
+
+ # see if we have reached the end of the current controlling container
+ if ( $seqno_top && $seqno == $seqno_top ) {
+ $seqno_top = pop @seqno_stack;
+ }
+
# Patch to fix some block types...
# Certain block types arrive from the tokenizer without CI but should
# have it for this option. These include anonymous subs and
my $block_type = $rLL->[$KK]->[_BLOCK_TYPE_];
if ( $block_type && $is_block_with_ci{$block_type} ) {
$rLL->[$KK]->[_CI_LEVEL_] = 1;
- }
-
- # see if we have reached the end of the current controlling container
- my $seqno = $rLL->[$KK]->[_TYPE_SEQUENCE_];
- if ( $seqno_top && $seqno == $seqno_top ) {
- ## $rLL->[$KK]->[_CI_LEVEL_] = 1; ## should not be necessary
- $seqno_top = pop @seqno_stack;
- next;
+ if ($seqno_top) {
+ $rseqno_which_extended_ci->{$KK} = $seqno_top;
+ $ris_seqno_controlling_ci->{$seqno_top}++;
+ }
}
# If this does not have ci, update ci if necessary and continue looking
}
# We are looking for opening container tokens with ci
- my $K_opening = $K_opening_container->{$seqno};
next unless ( defined($K_opening) && $KK == $K_opening );
# Make sure there is a corresponding closing container
# options that the user has set regarding special indenting and
# outdenting.
- # This routine is mainly concerned with outdenting closing tokens but
- # has become a 'catchall' for a variety of special problems involving
- # ci. Note that there is some overlap with the functions of sub
- # undo_ci, which was processed earlier, so care has to be taken to keep
- # them coordinated.
+ # This routine is mainly concerned with outdenting closing tokens but
+ # has become a 'catchall' for a variety of special problems involving
+ # ci. Note that there is some overlap with the functions of sub
+ # undo_ci, which was processed earlier, so care has to be taken to keep
+ # them coordinated.
my (
$self, $ibeg,
# and do not undo ci if it was set by the -xci option
$adjust_indentation = 1
- if (
- $level_next < $lev
- && !$rseqno_which_extended_ci->{$K_beg}
- );
+ if ( $level_next < $lev
+ && !$rseqno_which_extended_ci->{$K_beg} );
}
# Patch for RT #96101, in which closing brace of anonymous subs
package Perl::Tidy::HtmlWriter;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
use File::Basename;
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================
use strict;
use warnings;
use Carp;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
sub AUTOLOAD {
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================
use strict;
use warnings;
use Carp;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
sub AUTOLOAD {
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================
package Perl::Tidy::IndentationItem;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
BEGIN {
package Perl::Tidy::LineBuffer;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
sub AUTOLOAD {
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================
package Perl::Tidy::LineSink;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
sub AUTOLOAD {
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================
package Perl::Tidy::LineSource;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
sub AUTOLOAD {
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================
package Perl::Tidy::Logger;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
sub AUTOLOAD {
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================
package Perl::Tidy::Tokenizer;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
use Perl::Tidy::LineBuffer;
use Carp;
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================
if ( $level_in_tokenizer > $tokenizer_self->[_maximum_level_] )
{
- $tokenizer_self->[ _maximum_level_ ] = $level_in_tokenizer;
+ $tokenizer_self->[_maximum_level_] = $level_in_tokenizer;
}
if ($forced_indentation_flag) {
package Perl::Tidy::VerticalAligner;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
use Perl::Tidy::VerticalAligner::Alignment;
use Perl::Tidy::VerticalAligner::Line;
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================
sub get_output_line_number {
- # The output line number reported to a caller =
+ # The output line number reported to a caller =
# the number of items still in the buffer +
# the number of items written.
return $_[0]->group_line_count() +
{ #<<< A non-indenting brace
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
# _column_ # the current column number
# _starting_column_ # column number when created
package Perl::Tidy::VerticalAligner::Line;
use strict;
use warnings;
-our $VERSION = '20201001.01';
+our $VERSION = '20201001.02';
BEGIN {
my $i = 0;
# some diagnostic information. This sub should never be called
# except for a programming error.
our $AUTOLOAD;
- return if ( $AUTOLOAD =~/\bDESTROY$/ );
+ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller();
print STDERR <<EOM;
======================================================================