]> git.donarmstrong.com Git - perltidy.git/commitdiff
update perltidy package
authordon <don@8f7917da-ec0b-0410-a553-b9b0e350d17e>
Thu, 17 May 2007 23:34:45 +0000 (23:34 +0000)
committerdon <don@8f7917da-ec0b-0410-a553-b9b0e350d17e>
Thu, 17 May 2007 23:34:45 +0000 (23:34 +0000)
CHANGES
META.yml
bin/perltidy
debian/changelog
docs/perltidy.1
lib/Perl/Tidy.pm

diff --git a/CHANGES b/CHANGES
index 2182657737d36844b58649ad7195b646cc425833..3690933a29506ea51be53357d01898d7eb4d977a 100644 (file)
--- 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,
index 7ebc196ad8958d9327d274480a4d484a456aba7b..26543420e74474dd2fda3842daccc03f238f32bb 100644 (file)
--- 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:
index 141f10ab023117638332ce01ca23358cbab38294..b4255d3f481820bd1a38098aa40d6e443883fdd7 100755 (executable)
@@ -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
 
index d95b060c9ed47882db9e36d172e983588e9304bf..4295488f5ed55b8fb305959e89637a66da98354d 100644 (file)
@@ -1,9 +1,9 @@
-perltidy (20070428-1) unstable; urgency=low
+perltidy (20070508-1) unstable; urgency=low
 
   * New upstream release
 
  -- Don Armstrong <don@debian.org>  Tue,  1 May 2007 03:03:29 -0700
+
 perltidy (20060719-1) unstable; urgency=low
 
   * New upstream release
index e75cfa43ed8f3a16d5109a9ed1d508f54d80a75a..5c4f9366bd67fa49d8e4cd9403d70ceb91f3de3e 100644 (file)
 .\" ========================================================================
 .\"
 .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
index 86764c33f65c68e6f00cbd9561e07785d272628f..7fb05356a8e4eff475be8ab30a4252a5d340e159 100644 (file)
@@ -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