]> git.donarmstrong.com Git - perltidy.git/commitdiff
version change to 20190915
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 14 Sep 2019 04:13:09 +0000 (21:13 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 14 Sep 2019 04:13:09 +0000 (21:13 -0700)
24 files changed:
CHANGES.md
bin/perltidy
docs/ChangeLog.html
docs/Tidy.html
docs/perltidy.html
lib/Perl/Tidy.pm
lib/Perl/Tidy.pod
lib/Perl/Tidy/Debugger.pm
lib/Perl/Tidy/DevNull.pm
lib/Perl/Tidy/Diagnostics.pm
lib/Perl/Tidy/FileWriter.pm
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/HtmlWriter.pm
lib/Perl/Tidy/IOScalar.pm
lib/Perl/Tidy/IOScalarArray.pm
lib/Perl/Tidy/IndentationItem.pm
lib/Perl/Tidy/LineBuffer.pm
lib/Perl/Tidy/LineSink.pm
lib/Perl/Tidy/LineSource.pm
lib/Perl/Tidy/Logger.pm
lib/Perl/Tidy/Tokenizer.pm
lib/Perl/Tidy/VerticalAligner.pm
lib/Perl/Tidy/VerticalAligner/Alignment.pm
lib/Perl/Tidy/VerticalAligner/Line.pm

index ee2c2b92ac1b4df940e944d2bebf71ee3c03b579..dc4d4d09bef9d484f382722e07ff723ebdaebb32 100644 (file)
@@ -1,6 +1,6 @@
 # Perltidy Change Log
 
-## 2019 06 01.01
+## 2019 09 15
 
     - implement issue RT#130425: check mode.  A new flag '--assert-tidy'
       will cause an error message if the output script is not identical to
       for "use lib". 
 
     - fixed issue RT#130304: standard error output should include filename.
-      When perltidy error messages are directed to the standard error output with
-      -se or --standard-error-output, the message lines now have a prefix with
-      'filename:' for clarification when multiple files are processed.  If an
-      input filename is not known, for example when input is from the standard
-      input or a data structure, then displayed filename is 'perltidy'.
+      When perltidy error messages are directed to the standard error output 
+      with -se or --standard-error-output, the message lines now have a prefix 
+      'filename:' for clarification in case multiple files 
+      are processed, where 'filename' is the name of the input file.  If 
+      input is from the standard input the displayed filename is '<stdin>', 
+      and if it is from a data structure then displayed filename 
+      is '<source_stream>'.
 
     - fixed issue RT#130297; the perltidy script now exits with a nonzero exit 
       status if it wrote to the standard error output. Prevously only fatal
@@ -28,8 +30,8 @@
       flag now has these values:
 
          0 = no errors
-         1 = fatal error
-         2 = non-fatal error
+         1 = perltidy could not run to completion due to errors
+         2 = perltidy ran to completion with error messages
 
     - added warning message for RT#130008, which warns of conflicting input
       parameters -iob and -bom or -boc.
@@ -40,7 +42,7 @@
        my @addunix = map { File::Spec::Unix->catfile( @ROOT, @$_ ) } ['b'];
 
       Formerly, any space was removed. Now it is optional, and the output will
-      follow the input.  
+      follow the input.
 
     - fixed issue git#13, needless trailing whitespace in error message
 
index d158067026048fd9d7024ad2d0fa987fa4d29c02..5617bcd53707ab3a381f502f89f9297a4bcab63b 100755 (executable)
@@ -14,9 +14,9 @@ if ( $^O =~ /Mac/ ) {
 }
 
 # Exit codes returned by perltidy:
-#    0 - successful run without errors
-#    1 - run terminated with a fatal error
-#    2 - successful run but with non-fatal warning messages
+#    0 = no errors
+#    1 = perltidy could not run to completion due to errors
+#    2 = perltidy ran to completion with error messages
 exit Perl::Tidy::perltidy( argv => $arg_string );
 
 __END__
@@ -364,6 +364,7 @@ as non-text, and this flag forces perltidy to process them.
 This flag asserts that the input and output code streams are identical, or in
 other words that the input code is already 'tidy' according to the formatting
 parameters.  If this is not the case, an error message noting this is produced.
+This error message will cause the process to return a non-zero exit code.
 The test for this is made by comparing an MD5 hash value for the input and
 output code streams. This flag has no other effect on the functioning of
 perltidy.  This might be useful for certain code maintenance operations.
@@ -3750,13 +3751,29 @@ F<somefile.tdy.tdy.tdy>.
 
 =back
 
+=head1 ERROR HANDLING
+
+An exit value of 0, 1, or 2 is returned by perltidy to indicate the status of the result.
+
+A exit value of 0 indicates that perltidy ran to completion with no error messages.
+
+An exit value of 1 indicates that the process had to be terminated early due to
+errors in the input parameters.  This can happen for example if a parameter is
+misspelled or given an invalid value.  Error messages in the standard
+error output will indicate the cause of any problem.  
+
+An exit value of 2 indicates that perltidy ran to completion but there there
+are warning messages in the standard error output related to parameter errors or
+conflicts and/or warning messages in the perltidy error file(s) relating to
+possible syntax errors in the source code being tidied. 
+
 =head1 SEE ALSO
 
 perlstyle(1), Perl::Tidy(3)
 
 =head1 VERSION
 
-This man page documents perltidy version 20190601.01
+This man page documents perltidy version 20190915
 
 =head1 BUG REPORTS
 
index 770059260479957f1f353500b52dc212cdca5c62..b1093224c1399a12b1a822cf6a4cec7ea8499b6e 100644 (file)
@@ -1,5 +1,58 @@
 <h1>Perltidy Change Log</h1>
 
+<h2>2019 09 15</h2>
+
+<pre><code>- implement issue RT#130425: check mode.  A new flag '--assert-tidy'
+  will cause an error message if the output script is not identical to
+  the input script. For completeness, the opposite flag '--assert-untidy'
+  has also been added.
+
+- iteration speedup for unchanged code.  Previously, when iterations were
+  requested, at least two formatting passes were made. Now just a single pass
+  is made if the formatted code is identical to the input code.
+
+- fixed issue RT#130344: false warning "operator in print statement" 
+  for "use lib". 
+
+- fixed issue RT#130304: standard error output should include filename.
+  When perltidy error messages are directed to the standard error output 
+  with -se or --standard-error-output, the message lines now have a prefix 
+  'filename:' for clarification in case multiple files 
+  are processed, where 'filename' is the name of the input file.  If 
+  input is from the standard input the displayed filename is '&lt;stdin&gt;', 
+  and if it is from a data structure then displayed filename 
+  is '&lt;source_stream&gt;'.
+
+- fixed issue RT#130297; the perltidy script now exits with a nonzero exit 
+  status if it wrote to the standard error output. Prevously only fatal
+  run errors produced a non-zero exit flag. Now, even non-fatal messages
+  requested with the -w flag will cause a non-zero exit flag.  The exit
+  flag now has these values:
+
+     0 = no errors
+     1 = perltidy could not run to completion due to errors
+     2 = perltidy ran to completion with error messages
+
+- added warning message for RT#130008, which warns of conflicting input
+  parameters -iob and -bom or -boc.
+
+- fixed RT#129850; concerning a space between a closing block brace and
+  opening bracket or brace, as occurs before the '[' in this line:
+
+   my @addunix = map { File::Spec::Unix-&gt;catfile( @ROOT, @$_ ) } ['b'];
+
+  Formerly, any space was removed. Now it is optional, and the output will
+  follow the input.
+
+- fixed issue git#13, needless trailing whitespace in error message
+
+- fixed issue git#9: if the -ce (--cuddled-else) flag is used,
+  do not try to form new one line blocks for a block type 
+  specified with -cbl, particularly map, sort, grep
+
+- some improved vertical alignments
+</code></pre>
+
 <h2>2019 06 01</h2>
 
 <pre><code>- rt #128477: Prevent inconsistent owner/group and setuid/setgid bits. 
@@ -468,7 +521,7 @@ NEW:
 
  - Fixed RT #107832 and #106492, lack of vertical alignment of two lines
    when -boc flag (break at old commas) is set.  This bug was 
-   inadvertently introduced in previous bug fix RT #98902.
+   inadvertently introduced in previous bug fix RT #98902. 
 
  - Some common extensions to Perl syntax are handled better.
    In particular, the following snippet is now foratted cleanly:
index 2d3a162aa8ad9fffba3724f58ce3b897317eba95..d77229bc75174dbd9bb8508a235f8246ac38a9cf 100644 (file)
 
 <h1 id="ERROR-HANDLING">ERROR HANDLING</h1>
 
-<p>Perltidy will return with an error flag indicating if the process had to be terminated early due to errors in the input parameters. This can happen for example if a parameter is misspelled or given an invalid value. The calling program should check this flag because if it is set the destination stream will be empty or incomplete and should be ignored. Error messages in the <b>stderr</b> stream will indicate the cause of any problem.</p>
+<p>An exit value of 0, 1, or 2 is returned by perltidy to indicate the status of the result.</p>
 
-<p>If the error flag is not set then perltidy ran to completion. However there may still be warning messages in the <b>stderr</b> stream related to control parameters, and there may be warning messages in the <b>errorfile</b> stream relating to possible syntax errors in the source code being tidied.</p>
+<p>A exit value of 0 indicates that perltidy ran to completion with no error messages.</p>
+
+<p>An exit value of 1 indicates that the process had to be terminated early due to errors in the input parameters. This can happen for example if a parameter is misspelled or given an invalid value. The calling program should check for this flag because if it is set the destination stream will be empty or incomplete and should be ignored. Error messages in the <b>stderr</b> stream will indicate the cause of any problem.</p>
+
+<p>An exit value of 2 indicates that perltidy ran to completion but there there are warning messages in the <b>stderr</b> stream related to parameter errors or conflicts and/or warning messages in the <b>errorfile</b> stream relating to possible syntax errors in the source code being tidied.</p>
 
 <p>In the event of a catastrophic error for which recovery is not possible <b>perltidy</b> terminates by making calls to <b>croak</b> or <b>confess</b> to help the programmer localize the problem. These should normally only occur during program development.</p>
 
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents Perl::Tidy version 20190601</p>
+<p>This man page documents Perl::Tidy version 20190915</p>
 
 <h1 id="LICENSE">LICENSE</h1>
 
index abaddf000807bea4a79d2fb01547a600a591e404..7399b90da4315ddf2b80680727473d801468e82c 100644 (file)
@@ -47,6 +47,7 @@
   <li><a href="#SWITCHES-WHICH-MAY-BE-NEGATED">SWITCHES WHICH MAY BE NEGATED</a></li>
   <li><a href="#LIMITATIONS">LIMITATIONS</a></li>
   <li><a href="#FILES">FILES</a></li>
+  <li><a href="#ERROR-HANDLING">ERROR HANDLING</a></li>
   <li><a href="#SEE-ALSO">SEE ALSO</a></li>
   <li><a href="#VERSION">VERSION</a></li>
   <li><a href="#BUG-REPORTS">BUG REPORTS</a></li>
 
 <p>Force perltidy to process binary files. To avoid producing excessive error messages, perltidy skips files identified by the system as non-text. However, valid perl scripts containing binary data may sometimes be identified as non-text, and this flag forces perltidy to process them.</p>
 
+</dd>
+<dt id="ast---assert-tidy"><b>-ast</b>, <b>--assert-tidy</b></dt>
+<dd>
+
+<p>This flag asserts that the input and output code streams are identical, or in other words that the input code is already &#39;tidy&#39; according to the formatting parameters. If this is not the case, an error message noting this is produced. This error message will cause the process to return a non-zero exit code. The test for this is made by comparing an MD5 hash value for the input and output code streams. This flag has no other effect on the functioning of perltidy. This might be useful for certain code maintenance operations.</p>
+
+</dd>
+<dt id="asu---assert-untidy"><b>-asu</b>, <b>--assert-untidy</b></dt>
+<dd>
+
+<p>This flag asserts that the input and output code streams are different, or in other words that the input code is &#39;untidy&#39; according to the formatting parameters. If this is not the case, an error message noting this is produced. This flag has no other effect on the functioning of perltidy.</p>
+
 </dd>
 </dl>
 
 </dd>
 </dl>
 
+<h1 id="ERROR-HANDLING">ERROR HANDLING</h1>
+
+<p>An exit value of 0, 1, or 2 is returned by perltidy to indicate the status of the result.</p>
+
+<p>A exit value of 0 indicates that perltidy ran to completion with no error messages.</p>
+
+<p>An exit value of 1 indicates that the process had to be terminated early due to errors in the input parameters. This can happen for example if a parameter is misspelled or given an invalid value. Error messages in the standard error output will indicate the cause of any problem.</p>
+
+<p>An exit value of 2 indicates that perltidy ran to completion but there there are warning messages in the standard error output related to parameter errors or conflicts and/or warning messages in the perltidy error file(s) relating to possible syntax errors in the source code being tidied.</p>
+
 <h1 id="SEE-ALSO">SEE ALSO</h1>
 
 <p>perlstyle(1), Perl::Tidy(3)</p>
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents perltidy version 20190601</p>
+<p>This man page documents perltidy version 20190915</p>
 
 <h1 id="BUG-REPORTS">BUG REPORTS</h1>
 
index 7c3dca83d05c9e2a407f60458c72f14009ac9b04..1e9cd61d3bde0782c7b787a7e2d2a086a2e02a75 100644 (file)
@@ -110,7 +110,7 @@ BEGIN {
     # Release version must be bumped, and it is probably past time for a
     # release anyway.
 
-    $VERSION = '20190601.01';
+    $VERSION = '20190915';
 }
 
 sub streamhandle {
@@ -1475,11 +1475,10 @@ EOM
     # standard error output, even non-fatal warning messages, otherwise return
     # false.
 
-    # To allow the caller to determine the error severity, these exit codes are
-    # returned:
-    #    0 - successful run without errors
-    #    1 - run terminated with a fatal error
-    #    2 - successful run but with non-fatal warning messages
+    # These exit codes are returned:
+    #  0 = perltidy ran to completion with no errors
+    #  1 = perltidy could not run to completion due to errors
+    #  2 = perltidy ran to completion with error messages
 
     # Note that if perltidy is run with multiple files, any single file with
     # errors or warnings will write a line like
index 6c677bc08b1e2b95c0d912d528baa4585db156cd..41e0abf3d23e2db1fb4205142346c62a37a37e98 100644 (file)
@@ -188,17 +188,21 @@ B<filter_example.pl> in the perltidy distribution.
 
 =head1 ERROR HANDLING
 
-Perltidy will return with an error flag indicating if the process had to be
-terminated early due to errors in the input parameters.  This can happen for
-example if a parameter is misspelled or given an invalid value.  The calling
-program should check this flag because if it is set the destination stream will
-be empty or incomplete and should be ignored.  Error messages in the B<stderr>
-stream will indicate the cause of any problem.  
-
-If the error flag is not set then perltidy ran to completion.   However there
-may still be warning messages in the B<stderr> stream related to control
-parameters, and there may be warning messages in the B<errorfile> stream
-relating to possible syntax errors in the source code being tidied.  
+An exit value of 0, 1, or 2 is returned by perltidy to indicate the status of the result.
+
+A exit value of 0 indicates that perltidy ran to completion with no error messages.
+
+An exit value of 1 indicates that the process had to be terminated early due to
+errors in the input parameters.  This can happen for example if a parameter is
+misspelled or given an invalid value.  The calling program should check for
+this flag because if it is set the destination stream will be empty or
+incomplete and should be ignored.  Error messages in the B<stderr> stream will
+indicate the cause of any problem.  
+
+An exit value of 2 indicates that perltidy ran to completion but there there
+are warning messages in the B<stderr> stream related to parameter errors or
+conflicts and/or warning messages in the B<errorfile> stream relating to
+possible syntax errors in the source code being tidied. 
 
 In the event of a catastrophic error for which recovery is not possible
 B<perltidy> terminates by making calls to B<croak> or B<confess> to help the
@@ -410,7 +414,7 @@ C<write_debug_entry> in Tidy.pm.
 
 =head1 VERSION
 
-This man page documents Perl::Tidy version 20190601.01
+This man page documents Perl::Tidy version 20190915
 
 =head1 LICENSE
 
index 7a5d60ee1a6a9dbf3c0603866c1a9d3a00064dcb..1c2712638acc8cd835ad3aa86de940f95a32ddf5 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::Debugger;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 sub new {
 
index d126d3f5100f6af44a9da00b584319721be36e09..1c36597c2416064e93b23b75b21cccc8f457c27c 100644 (file)
@@ -7,8 +7,8 @@
 package Perl::Tidy::DevNull;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
-sub new { my $self = shift; return bless {}, $self }
+our $VERSION = '20190915';
+sub new   { my $self = shift; return bless {}, $self }
 sub print { return }
 sub close { return }
 
index f8175e1b0c368c77e84a36c42b1cd5eb06fa47ed..50c6f20effe26a6487db2831bb7a8a9087680edc 100644 (file)
@@ -20,7 +20,7 @@
 package Perl::Tidy::Diagnostics;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 sub new {
 
index 4c6ed7ff92254b4add247c89918c323e5eaaab08..fa033d67e823ebd22ccd2015493a078982397c2b 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::FileWriter;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 # Maximum number of little messages; probably need not be changed.
 my $MAX_NAG_MESSAGES = 6;
index 4da556c5645cb90abe4c64c29a1c280c41bb2f11..56c936768e35c25bc463cdacb23b251aa1b6711d 100644 (file)
@@ -12,7 +12,7 @@ package Perl::Tidy::Formatter;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 # The Tokenizer will be loaded with the Formatter
 ##use Perl::Tidy::Tokenizer;    # for is_keyword()
@@ -645,12 +645,12 @@ sub new {
     $gnu_position_predictor = 0;    # where the current token is predicted to be
     $max_gnu_stack_index    = 0;
     $max_gnu_item_index     = -1;
-    $gnu_stack[0] = new_lp_indentation_item( 0, -1, -1, 0, 0 );
-    @gnu_item_list                   = ();
-    $last_output_indentation         = 0;
-    $last_indentation_written        = 0;
-    $last_unadjusted_indentation     = 0;
-    $last_leading_token              = "";
+    $gnu_stack[0]                = new_lp_indentation_item( 0, -1, -1, 0, 0 );
+    @gnu_item_list               = ();
+    $last_output_indentation     = 0;
+    $last_indentation_written    = 0;
+    $last_unadjusted_indentation = 0;
+    $last_leading_token          = "";
     $last_output_short_opening_token = 0;
 
     $saw_VERSION_in_this_file = !$rOpts->{'pass-version-line'};
@@ -1586,7 +1586,7 @@ sub break_lines {
                 # out of __END__ and __DATA__ sections, because
                 # the user may be using this section for any purpose whatsoever
                 if ( $rOpts->{'delete-pod'} ) { $skip_line = 1; }
-                if ( $rOpts->{'tee-pod'} )    { $tee_line  = 1; }
+                if ( $rOpts->{'tee-pod'} )    { $tee_line = 1; }
                 if ( $rOpts->{'trim-pod'} )   { $input_line =~ s/\s+$// }
                 if (   !$skip_line
                     && !$in_format_skipping_section
@@ -1849,7 +1849,7 @@ sub initialize_whitespace_hashes {
     $binary_ws_rules{'t'}{'L'} = WS_NO;
     $binary_ws_rules{'t'}{'{'} = WS_NO;
     $binary_ws_rules{'}'}{'L'} = WS_NO;
-    $binary_ws_rules{'}'}{'{'} = WS_OPTIONAL; # RT#129850; was WS_NO
+    $binary_ws_rules{'}'}{'{'} = WS_OPTIONAL;    # RT#129850; was WS_NO
     $binary_ws_rules{'$'}{'L'} = WS_NO;
     $binary_ws_rules{'$'}{'{'} = WS_NO;
     $binary_ws_rules{'@'}{'L'} = WS_NO;
@@ -5683,9 +5683,9 @@ EOM
             );
         }
 
-       # Note: there are additional parameters that can be made inactive by
-       # -iob, but they are on by default so we would generate excessive
-       # warnings if we noted them. They are:
+        # Note: there are additional parameters that can be made inactive by
+        # -iob, but they are on by default so we would generate excessive
+        # warnings if we noted them. They are:
         # $rOpts->{'break-at-old-keyword-breakpoints'}
         # $rOpts->{'break-at-old-logical-breakpoints'}
         # $rOpts->{'break-at-old-ternary-breakpoints'}
@@ -5912,9 +5912,9 @@ sub bad_pattern {
                 $rcuddled_block_types->{$start}->{$word} =
                   1;    #"$string_count.$word_count";
 
-               # git#9: Remove this word from the list of desired one-line
-               # blocks
-               $want_one_line_block{$word} = 0;
+                # git#9: Remove this word from the list of desired one-line
+                # blocks
+                $want_one_line_block{$word} = 0;
             }
         }
         return;
@@ -9735,7 +9735,7 @@ sub send_lines_to_vertical_aligner {
         my $ibeg = $ri_first->[$n];
         my $iend = $ri_last->[$n];
 
-        delete_needless_alignments($ibeg, $iend ); 
+        delete_needless_alignments( $ibeg, $iend );
 
         my ( $rtokens, $rfields, $rpatterns ) =
           make_alignment_patterns( $ibeg, $iend );
@@ -9932,28 +9932,28 @@ sub send_lines_to_vertical_aligner {
 
         # map certain operators to the same class for pattern matching
         %operator_map = (
-          '!~' => '=~',
-          '+=' => '+=',
-          '-=' => '+=',
-          '*=' => '+=',
-          '/=' => '+=',
-       );
+            '!~' => '=~',
+            '+=' => '+=',
+            '-=' => '+=',
+            '*=' => '+=',
+            '/=' => '+=',
+        );
     }
 
     sub delete_needless_alignments {
         my ( $ibeg, $iend ) = @_;
 
-        # Remove unwanted alignments.  This routine is a place to remove alignments
-        # which might cause problems at later stages.  There are currently
-       # two types of fixes:
+     # Remove unwanted alignments.  This routine is a place to remove alignments
+     # which might cause problems at later stages.  There are currently
+     # two types of fixes:
 
-       # 1. Remove excess parens
-       # 2. Remove alignments within 'elsif' conditions
+        # 1. Remove excess parens
+        # 2. Remove alignments within 'elsif' conditions
 
-       # Patch #1: Excess alignment of parens can prevent other good
-       # alignments.  For example, note the parens in the first two rows of
-       # the following snippet.  They would normally get marked for alignment
-       # and aligned as follows:
+        # Patch #1: Excess alignment of parens can prevent other good
+        # alignments.  For example, note the parens in the first two rows of
+        # the following snippet.  They would normally get marked for alignment
+        # and aligned as follows:
 
         #    my $w = $columns * $cell_w + ( $columns + 1 ) * $border;
         #    my $h = $rows * $cell_h +    ( $rows + 1 ) * $border;
@@ -9971,25 +9971,25 @@ sub send_lines_to_vertical_aligner {
         # the exception that we always keep alignment of the first opening
         # paren on a line (for things like 'if' and 'elsif' statements).
 
-       # Setup needed constants
-        my $i_good_paren = -1;
-        my $imin_match   = $iend + 1;
+        # Setup needed constants
+        my $i_good_paren  = -1;
+        my $imin_match    = $iend + 1;
         my $i_elsif_close = $ibeg - 1;
         my $i_elsif_open  = $iend + 1;
         if ( $iend > $ibeg ) {
             if ( $types_to_go[$ibeg] eq 'k' ) {
 
-               # Paren patch: mark a location of a paren we should keep, such
-               # as one following something like a leading 'if', 'elsif',..
+                # Paren patch: mark a location of a paren we should keep, such
+                # as one following something like a leading 'if', 'elsif',..
                 $i_good_paren = $ibeg + 1;
                 if ( $types_to_go[$i_good_paren] eq 'b' ) {
                     $i_good_paren++;
                 }
 
-               # 'elsif' patch: remember the range of the parens of an elsif,
-               # and do not make alignments within them because this can cause
-               # loss of padding and overall brace alignment in the vertical
-               # aligner.
+                # 'elsif' patch: remember the range of the parens of an elsif,
+                # and do not make alignments within them because this can cause
+                # loss of padding and overall brace alignment in the vertical
+                # aligner.
                 if (   $tokens_to_go[$ibeg] eq 'elsif'
                     && $i_good_paren < $iend
                     && $tokens_to_go[$i_good_paren] eq '(' )
@@ -10000,13 +10000,13 @@ sub send_lines_to_vertical_aligner {
             }
         }
 
-       # Loop to make the fixes on this line
+        # Loop to make the fixes on this line
         my @imatch_list;
         for my $i ( $ibeg .. $iend ) {
 
             if ( $matching_token_to_go[$i] ne '' ) {
 
-               # Patch #2: undo alignment within elsif parens
+                # Patch #2: undo alignment within elsif parens
                 if ( $i > $i_elsif_open && $i < $i_elsif_close ) {
                     $matching_token_to_go[$i] = '';
                     next;
index 72bbf5f61440c88f938660442d4e6eeb85efc509..34c26e78575ab86b8d2f88cf5a616770fefb37d1 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::HtmlWriter;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 use File::Basename;
 
index 7c98aafbc39ebc135397aea0d604c2cabb5bb552..881cee309842663092a9dd2415b4472ddbcfa16f 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 sub new {
     my ( $package, $rscalar, $mode ) = @_;
index 0f152f0e597f9a2c5bc5af88c5762255de2ecfd4..e4f6c8e75f7472d9d08a7930824c37aa4e039519 100644 (file)
@@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 sub new {
     my ( $package, $rarray, $mode ) = @_;
index 9eb7d51d3c2bed5d32cd190c7c8f00cc66029a67..ec5d3802cc935e7882659a0b1bf18d352fe35f2b 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::IndentationItem;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 sub new {
 
index fdd181517595f5ee849fe43c4e9f9d63aa5618dd..fd82d129ce2a6d108d50ff2e9f4929042afc8713 100644 (file)
@@ -12,7 +12,7 @@
 package Perl::Tidy::LineBuffer;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 sub new {
 
index 2719e7fec0165e65c3db3a7239119dc6548417fe..0f6d7be85635e7356eec16e96e1f2379b7c82bea 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::LineSink;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 sub new {
 
index 3b89ca8f4bbe674cc72e14ca8eb25a2a5286a594..2b0f2fb0f79c2aae4ae4352a6f312b8f15acaa9d 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::LineSource;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 sub new {
 
index 332767afc0c1af03c6c7ad455a35856119e2eb79..5eb93b8cf2b122816c5bab2ac88907579396857c 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::Logger;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 sub new {
 
index 48f8f93771c7fe80748479c2b48d320609aa6de2..60ad3392623b4074a7acf007bb67b7826bdf72f5 100644 (file)
@@ -21,7 +21,7 @@
 package Perl::Tidy::Tokenizer;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 use Perl::Tidy::LineBuffer;
 
@@ -3221,7 +3221,7 @@ EOM
                 elsif (
                        ( $next_nonblank_token eq ':' )
                     && ( $rtokens->[ $i_next + 1 ] ne ':' )
-                    && ( $i_next <= $max_token_index )      # colon on same line
+                    && ( $i_next <= $max_token_index )    # colon on same line
                     && label_ok()
                   )
                 {
@@ -4226,12 +4226,12 @@ sub operator_expected {
         else {
             if ( $tok =~ /^([x\/\+\-\*\%\&\.\?\<]|\>\>)$/ ) {
 
-               # Do not complain in 'use' statements, which have special syntax. 
-                # For example, from RT#130344:
-                #   use lib $FindBin::Bin . '/lib';
-               if ($statement_type ne 'use') {
+               # Do not complain in 'use' statements, which have special syntax.
+               # For example, from RT#130344:
+               #   use lib $FindBin::Bin . '/lib';
+                if ( $statement_type ne 'use' ) {
                     complain("operator in print statement not recommended\n");
-               }
+                }
                 $op_expected = OPERATOR;
             }
         }
index 6f4eff25fa879040e88a4e029b38d8d14e32446a..c22b84ea358879d914ea3e62a2a57c62574b552b 100644 (file)
@@ -1,7 +1,7 @@
 package Perl::Tidy::VerticalAligner;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 use Perl::Tidy::VerticalAligner::Alignment;
 use Perl::Tidy::VerticalAligner::Line;
@@ -2326,7 +2326,7 @@ sub delete_unmatched_tokens {
 
     # This is a preliminary step in vertical alignment in which we remove as
     # many obviously un-needed alignment tokens as possible.  This will prevent
-    # them from interfering with the final alignment. 
+    # them from interfering with the final alignment.
 
     return unless @{$rlines};
     my $has_terminal_match = $rlines->[-1]->get_j_terminal_match();
@@ -2337,7 +2337,7 @@ sub delete_unmatched_tokens {
     my @i_equals;
     my @min_levels;
 
-    my $jmax = @{$rnew_lines}-1;
+    my $jmax = @{$rnew_lines} - 1;
 
     my %is_good_tok;
 
@@ -2350,22 +2350,26 @@ sub delete_unmatched_tokens {
         my $i_eq;
         my $lev_min;
         foreach my $tok ( @{$rtokens} ) {
-            my $lev=0; 
-           my $raw_tok="";
-           my $desc="";
-           if ($tok =~ /^(\D+)(\d+)(.*)/) { $raw_tok=$1; $lev = $2; $desc=$3}
-           if (!defined($lev_min) || $lev < $lev_min) {$lev_min=$lev}
+            my $lev     = 0;
+            my $raw_tok = "";
+            my $desc    = "";
+            if ( $tok =~ /^(\D+)(\d+)(.*)/ ) {
+                $raw_tok = $1;
+                $lev     = $2;
+                $desc    = $3;
+            }
+            if ( !defined($lev_min) || $lev < $lev_min ) { $lev_min = $lev }
 
             $rhash->{$tok} = [ $i, undef, undef, $lev ];
 
             # remember the first equals at line level
-            if ( !defined($i_eq) && $raw_tok eq '=') {
+            if ( !defined($i_eq) && $raw_tok eq '=' ) {
                 if ( $lev eq $group_level ) { $i_eq = $i }
             }
             $i++;
         }
         push @{$rline_hashes}, $rhash;
-        push @i_equals, $i_eq;
+        push @i_equals,   $i_eq;
         push @min_levels, $lev_min;
     }
 
@@ -2373,12 +2377,12 @@ sub delete_unmatched_tokens {
     my $rtok_hash = {};
     my $nr        = 0;
     for ( my $jl = 0 ; $jl < $jmax ; $jl++ ) {
-       my $nl = $nr;
-       $nr = 0;
+        my $nl = $nr;
+        $nr = 0;
         my $jr      = $jl + 1;
         my $rhash_l = $rline_hashes->[$jl];
         my $rhash_r = $rline_hashes->[$jr];
-        my $count   = 0; # UNUSED NOW?
+        my $count   = 0;                      # UNUSED NOW?
         my $ntoks   = 0;
         foreach my $tok ( keys %{$rhash_l} ) {
             $ntoks++;
@@ -2390,12 +2394,12 @@ sub delete_unmatched_tokens {
                 $rhash_r->{$tok}->[1] = $il;
                 if ( $tok ne '#' ) {
                     push @{ $rtok_hash->{$tok} }, ( $jl, $jr );
-                   $nr++;
+                    $nr++;
                 }
             }
         }
 
-       # Set a line break if no matching tokens between these lines
+        # Set a line break if no matching tokens between these lines
         if ( $nr == 0 && $nl > 0 ) {
             $rnew_lines->[$jl]->{_end_group} = 1;
         }
@@ -2431,11 +2435,11 @@ sub delete_unmatched_tokens {
         }
 
         # Look for if/else/elsif and ternary blocks
-        my $is_full_block; 
+        my $is_full_block;
         foreach my $tok ( keys %token_line_count ) {
             if ( $token_line_count{$tok} == $nlines ) {
                 if ( $tok =~ /^\?/ || $tok =~ /^\{\d+if/ ) {
-                   $is_full_block = 1;
+                    $is_full_block = 1;
                 }
             }
         }
@@ -2489,7 +2493,7 @@ sub delete_unmatched_tokens {
         }
     }    # End loop over subgroups
 
-    return; 
+    return;
 }
 
 sub decide_if_aligned_pair {
index f61d0c61de3319dcb31202b4520556377acfd95b..ca798416ea8fd45266b666aa107baa9d6d8ab2ae 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::VerticalAligner::Alignment;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 {
 
index e62ce3e777e5a9690126a435cc19fc0e7744814a..68a7f9fad8ea0bd3fe0a358cc8cc218c57144811 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::VerticalAligner::Line;
 use strict;
 use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
 
 {