Perl-Tidy
view release on metacpan or search on metacpan
example. Thanks to Richard Jelinek.
-A new flag --keep-old-blank-lines=n has been added to
give more control over the treatment of old blank lines in
a script. The manual has been revised to discuss the new
flag and clarify the treatment of old blank lines. Thanks
to Oliver Schaefer.
## 2007 12 05
-Improved support for perl 5.10: New quote modifier 'p', new block type UNITCHECK,
new keyword break, improved formatting of given/when.
-Corrected tokenization bug of something like $var{-q}.
-Numerous minor formatting improvements.
-Corrected list of operators controlled by -baao -bbao to include
. : ? && || and or err xor
-Corrected very minor error in log file involving incorrect comment
docs/ChangeLog.html view on Meta::CPAN
-A new flag --keep-old-blank-lines=n has been added to
give more control over the treatment of old blank lines in
a script. The manual has been revised to discuss the new
flag and clarify the treatment of old blank lines. Thanks
to Oliver Schaefer.
</code></pre>
<h2>2007 12 05</h2>
<pre><code>-Improved support for perl 5.10: New quote modifier 'p', new block type UNITCHECK,
new keyword break, improved formatting of given/when.
-Corrected tokenization bug of something like $var{-q}.
-Numerous minor formatting improvements.
-Corrected list of operators controlled by -baao -bbao to include
. : ? && || and or err xor
-Corrected very minor error in log file involving incorrect comment
lib/Perl/Tidy/Formatter.pm view on Meta::CPAN
# Note that some are keywords
@all_operators = qw{
% + - * / x != == >= <= =~ !~ < > | &
= **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=
. : ? && || and or err xor
};
# We can remove semicolons after blocks preceded by these keywords
@q = qw(
BEGIN END CHECK INIT AUTOLOAD DESTROY
UNITCHECK continue if elsif else unless
while until for foreach given when
default
);
@is_block_without_semicolon{@q} = (1) x scalar(@q);
# We will allow semicolons to be added within these block types
# as well as sub and package blocks.
# NOTES:
# 1. Note that these keywords are omitted:
# switch case given when default sort map grep
# 2. It is also ok to add for sub and package blocks and a labeled block
# 3. But not okay for other perltidy types including:
# { } ; G t
# 4. Test files: blktype.t, blktype1.t, semicolon.t
@q = qw( BEGIN END CHECK INIT AUTOLOAD DESTROY UNITCHECK continue if elsif
else unless do while until eval for foreach );
@ok_to_add_semicolon_for_block_type{@q} = (1) x scalar(@q);
# 'L' is token for opening { at hash key
@q = qw< L { ( [ >;
@is_opening_type{@q} = (1) x scalar(@q);
# 'R' is token for closing } at hash key
@q = qw< R } ) ] >;
@is_closing_type{@q} = (1) x scalar(@q);
lib/Perl/Tidy/Tokenizer.pm view on Meta::CPAN
# beginning of tokenizer hashes
#------------------------------
my %matching_start_token = ( '}' => '{', ']' => '[', ')' => '(' );
# These block types terminate statements and do not need a trailing
# semicolon
# patched for SWITCH/CASE/
my %is_zero_continuation_block_type;
my @q;
@q = qw( } { BEGIN END CHECK INIT AUTOLOAD DESTROY UNITCHECK continue ;
if elsif else unless while until for foreach switch case given when );
@is_zero_continuation_block_type{@q} = (1) x scalar(@q);
my %is_logical_container;
@q = qw( if elsif unless while and or err not && ! || for foreach );
@is_logical_container{@q} = (1) x scalar(@q);
my %is_binary_type;
@q = qw( || && );
@is_binary_type{@q} = (1) x scalar(@q);
lib/Perl/Tidy/Tokenizer.pm view on Meta::CPAN
@q = qw( my our state );
@is_my_our_state{@q} = (1) x scalar(@q);
# These tokens may precede a code block
# patched for SWITCH/CASE/CATCH. Actually these could be removed
# now and we could let the extended-syntax coding handle them.
# Added 'default' for Switch::Plain.
# Note: 'ADJUST' will be added by sub check_options if --use-feature=class
@q = qw(
BEGIN END CHECK INIT AUTOLOAD DESTROY
UNITCHECK continue if elsif else unless
do while until eval for foreach
map grep sort switch case given
when default catch try finally
);
@is_code_block_token{@q} = (1) x scalar(@q);
# Note: this hash was formerly named '%is_not_zero_continuation_block_type'
# to contrast it with the block types in '%is_zero_continuation_block_type'
# Note: added 'sub' for anonymous sub blocks (c443)
@q = qw( sort map grep eval do sub );
lib/Perl/Tidy/Tokenizer.pm view on Meta::CPAN
my @Keywords = ();
# keywords and tokens after which a value or pattern is expected,
# but not an operator. In other words, these should consume terms
# to their right, or at least they are not expected to be followed
# immediately by operators.
my @value_requestor = qw(
AUTOLOAD BEGIN CHECK DESTROY
END EQ GE GT
INIT LE LT NE
UNITCHECK abs accept alarm
and atan2 bind binmode
bless break caller chdir
chmod chomp chop chown
chr chroot close closedir
cmp connect continue cos
crypt dbmclose dbmopen defined
delete die dump each
else elsif eof eq
evalbytes exec exists exit
exp fc fcntl fileno
t/snippets14.t view on Meta::CPAN
find_encoding is_utf8);
use charnames qw(greek);
our $targetdir = "/usr/local/doc/HTML/Perl";
local (
$tocfile, $loffile, $lotfile, $footfile,
$citefile, $idxfile, $figure_captions, $table_captions,
$footnotes, $citations, %font_size, %index,
%done, $t_title, $t_author, $t_date,
$t_address, $t_affil, $changed
);
my @UNITCHECKs =
B::unitcheck_av->isa("B::AV")
? B::unitcheck_av->ARRAY
: ();
my @CHECKs = B::check_av->isa("B::AV") ? B::check_av->ARRAY : ();
my $dna = Bio::LiveSeq::DNA->new( -seq => $dnasequence );
my $min = 1;
my $max = length($dnasequence);
my $T = $G->_strongly_connected;
my %R = $T->vertex_roots;
my @C; # We're not calling the strongly_connected_components()
t/snippets14.t view on Meta::CPAN
use charnames qw(greek);
our $targetdir = "/usr/local/doc/HTML/Perl";
local (
$tocfile, $loffile, $lotfile, $footfile,
$citefile, $idxfile, $figure_captions, $table_captions,
$footnotes, $citations, %font_size, %index,
%done, $t_title, $t_author, $t_date,
$t_address, $t_affil, $changed
);
my @UNITCHECKs =
B::unitcheck_av->isa("B::AV")
? B::unitcheck_av->ARRAY
: ();
my @CHECKs = B::check_av->isa("B::AV") ? B::check_av->ARRAY : ();
my $dna = Bio::LiveSeq::DNA->new( -seq => $dnasequence );
my $min = 1;
my $max = length($dnasequence);
my $T = $G->_strongly_connected;
t/snippets14.t view on Meta::CPAN
find_encoding is_utf8);
use charnames qw(greek);
our $targetdir = "/usr/local/doc/HTML/Perl";
local (
$tocfile, $loffile, $lotfile, $footfile,
$citefile, $idxfile, $figure_captions, $table_captions,
$footnotes, $citations, %font_size, %index,
%done, $t_title, $t_author, $t_date,
$t_address, $t_affil, $changed
);
my @UNITCHECKs =
B::unitcheck_av->isa("B::AV")
? B::unitcheck_av->ARRAY
: ();
my @CHECKs = B::check_av->isa("B::AV") ? B::check_av->ARRAY : ();
my $dna = Bio::LiveSeq::DNA->new( -seq => $dnasequence );
my $min = 1;
my $max = length($dnasequence);
my $T = $G->_strongly_connected;
my %R = $T->vertex_roots;
my @C; # We're not calling the strongly_connected_components()
t/snippets14.t view on Meta::CPAN
use charnames qw(greek);
our $targetdir = "/usr/local/doc/HTML/Perl";
local (
$tocfile, $loffile, $lotfile, $footfile,
$citefile, $idxfile, $figure_captions, $table_captions,
$footnotes, $citations, %font_size, %index,
%done, $t_title, $t_author, $t_date,
$t_address, $t_affil, $changed
);
my @UNITCHECKs =
B::unitcheck_av->isa("B::AV")
? B::unitcheck_av->ARRAY
: ();
my @CHECKs = B::check_av->isa("B::AV") ? B::check_av->ARRAY : ();
my $dna = Bio::LiveSeq::DNA->new( -seq => $dnasequence );
my $min = 1;
my $max = length($dnasequence);
my $T = $G->_strongly_connected;
my %R = $T->vertex_roots;
my @C; # We're not calling the strongly_connected_components()
t/snippets14.t view on Meta::CPAN
use charnames qw(greek);
our $targetdir = "/usr/local/doc/HTML/Perl";
local (
$tocfile, $loffile, $lotfile, $footfile,
$citefile, $idxfile, $figure_captions, $table_captions,
$footnotes, $citations, %font_size, %index,
%done, $t_title, $t_author, $t_date,
$t_address, $t_affil, $changed
);
my @UNITCHECKs =
B::unitcheck_av->isa("B::AV")
? B::unitcheck_av->ARRAY
: ();
my @CHECKs = B::check_av->isa("B::AV") ? B::check_av->ARRAY : ();
my $dna = Bio::LiveSeq::DNA->new( -seq => $dnasequence );
my $min = 1;
my $max = length($dnasequence);
my $T = $G->_strongly_connected;
( run in 0.805 second using v1.01-cache-2.11-cpan-748bfb374f4 )