1 #####################################################################
3 # the Perl::Tidy::VerticalAligner::Alignment class holds information
4 # on a single column being aligned
6 #####################################################################
7 package Perl::Tidy::VerticalAligner::Alignment;
11 { #<<< A non-indenting brace
13 our $VERSION = '20210717';
15 # _column_ # the current column number
16 # _saved_column_ # a place for temporary storage
20 _saved_column_ => $i++,
24 my ( $class, $rarg ) = @_;
25 my $self = bless [], $class;
26 $self->[_column_] = $rarg->{column};
27 $self->[_saved_column_] = $rarg->{saved_column};
33 # Catch any undefined sub calls so that we are sure to get
34 # some diagnostic information. This sub should never be called
35 # except for a programming error.
37 return if ( $AUTOLOAD =~ /\bDESTROY$/ );
38 my ( $pkg, $fname, $lno ) = caller();
39 my $my_package = __PACKAGE__;
41 ======================================================================
42 Error detected in package '$my_package', version $VERSION
43 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
44 Called from package: '$pkg'
45 Called from File '$fname' at line '$lno'
46 This error is probably due to a recent programming change
47 ======================================================================
54 # required to avoid call to AUTOLOAD in some versions of perl
58 return $_[0]->[_column_];
61 sub increment_column {
62 $_[0]->[_column_] += $_[1];
67 $_[0]->[_saved_column_] = $_[0]->[_column_];
72 $_[0]->[_column_] = $_[0]->[_saved_column_];
75 } ## end of package VerticalAligner::Alignment