Perltidy Change Log
+ 2007 05 08
+ -Fixed bug where #line directives were being indented. Thanks to
+ Philippe Bruhat.
+
+ 2007 05 04
+ -Fixed problem where an extra blank line was added after an =cut when either
+ (a) the =cut started (not stopped) a POD section, or (b) -mbl > 1.
+ Thanks to J. Robert Ray and Bill Moseley.
+
2007 04 24
-ole (--output-line-ending) and -ple (--preserve-line-endings) should
now work on all systems rather than just unix systems. Thanks to Dan
The default is not to do this. Suggested by H.Merijn Brand.
-Added patch to avoid breaking GetOpt::Long::Configure set by calling program.
- Thanks to BOOK at CPAN.
+ Thanks to Philippe Bruhat.
-An error was fixed in which certain parameters in a .perltidyrc file given
without the equals sign were not recognized. That is,
use File::Basename;
BEGIN {
- ( $VERSION = q($Id: Tidy.pm,v 1.61 2007/04/24 13:31:15 perltidy Exp $) ) =~ s/^.*\s+(\d+)\/(\d+)\/(\d+).*$/$1$2$3/; # all one line for MakeMaker
+ ( $VERSION = q($Id: Tidy.pm,v 1.64 2007/05/08 20:01:45 perltidy Exp $) ) =~ s/^.*\s+(\d+)\/(\d+)\/(\d+).*$/$1$2$3/; # all one line for MakeMaker
}
sub streamhandle {
my $line_type = $line_of_tokens->{_line_type};
my $input_line = $line_of_tokens->{_line_text};
- my $want_blank_line_next = 0;
-
# _line_type codes are:
# SYSTEM - system-specific code before hash-bang line
# CODE - line of perl code (including comments)
# END_START - __END__ line
# END - unidentified text following __END__
# ERROR - we are in big trouble, probably not a perl script
- #
+
+ # put a blank line after an =cut which comes before __END__ and __DATA__
+ # (required by podchecker)
+ if ( $last_line_type eq 'POD_END' && !$saw_END_or_DATA_ ) {
+ $file_writer_object->reset_consecutive_blank_lines();
+ if ( $input_line !~ /^\s*$/ ) { want_blank_line() }
+ }
+
# handle line of code..
if ( $line_type eq 'CODE' ) {
{
want_blank_line();
}
-
- # patch to put a blank line after =cut
- # (required by podchecker)
- if ( $line_type eq 'POD_END' && !$saw_END_or_DATA_ ) {
- $file_writer_object->reset_consecutive_blank_lines();
- $want_blank_line_next = 1;
- }
}
# leave the blank counters in a predictable state
if ( !$skip_line ) {
if ($tee_line) { $file_writer_object->tee_on() }
write_unindented_line($input_line);
- if ($tee_line) { $file_writer_object->tee_off() }
- if ($want_blank_line_next) { want_blank_line(); }
+ if ($tee_line) { $file_writer_object->tee_off() }
}
}
$last_line_type = $line_type;
substr( $input_line, 0, 1 ) eq '#';
}
+ # Check for comments which are line directives
+ # Treat exactly as static block comments without leading space
+ # reference: perlsyn, near end, section Plain Old Comments (Not!)
+ # example: '# line 42 "new_filename.plx"'
+ if (
+ $jmax == 0
+ && $$rtoken_type[0] eq '#'
+ && $input_line =~ /^\# \s*
+ line \s+ (\d+) \s*
+ (?:\s("?)([^"]+)\2)? \s*
+ $/x
+ )
+ {
+ $is_static_block_comment = 1;
+ $is_static_block_comment_without_leading_space = 1;
+ }
+
# create a hanging side comment if appropriate
if (
$jmax == 0
# /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/
# Examples:
# *VERSION = \'1.01';
- # ( $VERSION ) = '$Revision: 1.61 $ ' =~ /\$Revision:\s+([^\s]+)/;
+ # ( $VERSION ) = '$Revision: 1.64 $ ' =~ /\$Revision:\s+([^\s]+)/;
# We will pass such a line straight through without breaking
# it unless -npvl is used
if ( $tokenizer_self->{_saw_data} || $tokenizer_self->{_saw_end} ) {
complain("=cut while not in pod ignored\n");
$tokenizer_self->{_in_pod} = 0;
- $line_of_tokens->{_line_type} = 'POD_STOP';
+ $line_of_tokens->{_line_type} = 'POD_END';
}
else {
- $line_of_tokens->{_line_type} = 'POD_END';
+ $line_of_tokens->{_line_type} = 'POD_START';
complain(
"=cut starts a pod section .. this can fool pod utilities.\n"
);
=head1 VERSION
-This man page documents Perl::Tidy version 20070424.
+This man page documents Perl::Tidy version 20070508.
=head1 AUTHOR