From: don Date: Thu, 17 May 2007 23:34:45 +0000 (+0000) Subject: update perltidy package X-Git-Tag: debian/20170521-1~39 X-Git-Url: https://git.donarmstrong.com/?p=perltidy.git;a=commitdiff_plain;h=87174f708ab5a68f937e277f96173e5fae3d4837 update perltidy package --- diff --git a/CHANGES b/CHANGES index 2182657..3690933 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,13 @@ 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 @@ -193,7 +202,7 @@ Perltidy Change Log 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, diff --git a/META.yml b/META.yml index 7ebc196..2654342 100644 --- a/META.yml +++ b/META.yml @@ -1,7 +1,7 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Perl-Tidy -version: 20070424 +version: 20070508 version_from: lib/Perl/Tidy.pm installdirs: site requires: diff --git a/bin/perltidy b/bin/perltidy index 141f10a..b4255d3 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -2615,7 +2615,7 @@ perlstyle(1), Perl::Tidy(3) =head1 VERSION -This man page documents perltidy version 20070424. +This man page documents perltidy version 20070508. =head1 CREDITS diff --git a/debian/changelog b/debian/changelog index d95b060..4295488 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -perltidy (20070428-1) unstable; urgency=low +perltidy (20070508-1) unstable; urgency=low * New upstream release -- Don Armstrong Tue, 1 May 2007 03:03:29 -0700 - + perltidy (20060719-1) unstable; urgency=low * New upstream release diff --git a/docs/perltidy.1 b/docs/perltidy.1 index e75cfa4..5c4f936 100644 --- a/docs/perltidy.1 +++ b/docs/perltidy.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "PERLTIDY 1" -.TH PERLTIDY 1 "2007-04-24" "perl v5.8.8" "User Contributed Perl Documentation" +.TH PERLTIDY 1 "2007-05-08" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" perltidy \- a perl script indenter and reformatter .SH "SYNOPSIS" @@ -2704,7 +2704,7 @@ purpose of this rule is to prevent generating confusing filenames such as \&\fIperlstyle\fR\|(1), \fIPerl::Tidy\fR\|(3) .SH "VERSION" .IX Header "VERSION" -This man page documents perltidy version 20070424. +This man page documents perltidy version 20070508. .SH "CREDITS" .IX Header "CREDITS" Michael Cartmell supplied code for adaptation to \s-1VMS\s0 and helped with diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 86764c3..7fb0535 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -64,7 +64,7 @@ use IO::File; 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 { @@ -5976,8 +5976,6 @@ sub write_line { 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) @@ -5993,7 +5991,14 @@ sub write_line { # 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' ) { @@ -6030,13 +6035,6 @@ sub write_line { { 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 @@ -6050,8 +6048,7 @@ sub write_line { 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; @@ -8374,6 +8371,23 @@ sub set_white_space_flag { 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 @@ -8476,7 +8490,7 @@ sub set_white_space_flag { # /([\$*])(([\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 @@ -20320,10 +20334,10 @@ sub get_line { 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" ); @@ -27175,7 +27189,7 @@ to perltidy. =head1 VERSION -This man page documents Perl::Tidy version 20070424. +This man page documents Perl::Tidy version 20070508. =head1 AUTHOR