]> git.donarmstrong.com Git - perltidy.git/commitdiff
update to v20230909 20230909
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 7 Sep 2023 14:55:32 +0000 (07:55 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 7 Sep 2023 14:55:32 +0000 (07:55 -0700)
20 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/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/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 4f5160317217805fb3a0ae2474fe9bf7355206b8..f215aba0bfad1529011a5a5a78d3a62d4c619348 100644 (file)
@@ -1,12 +1,12 @@
 # Perltidy Change Log
 
-## 2023 07 01.04
+## 2023 09 09
 
-    - Add parameters -wme, or --warn-missing-else, and -ame,
+    - Added new parameters -wme, or --warn-missing-else, and -ame,
       or --add-missing else.  The parameter -wme tells perltidy to issue
-      a warning to the error output if an if-elsif-elsif-... chain does
-      not end in an else block.  The parameter -ame tells perltidy to
-      insert an else block at the end of such a chain if there is none.
+      a warning if an if-elsif-... chain does not end in an else block.
+      The parameter -ame tells perltidy to insert an else block at the
+      end of such a chain if there is none.
 
       For example, given the following snippet:
 
             ##FIXME - added with perltidy -ame
         }
 
-      The resulting code should be carefully reviewed, and the comment should
-      be updated as appropriate.  The comment can be changed with parameter
-      -amec=s, where 's' is the comment in the else block.  The man pages
-      have more details.
+      The resulting code should be carefully reviewed, and the ##FIXME comment
+      should be updated as appropriate.  The text of the ##FIXME comment can be
+      changed with parameter -amec=s, where 's' is the comment to mark the new
+      else block. The man pages have more details.
 
     - The syntax of the parameter --use-feature=class, or -uf=class, which
       new in the previous release, has been changed slightly for clarity.
 
     - Issue git #122. Added parameter -lrt=n1:n2, or --line-range-tidy=n1:n2
       to limit tidy operations to a limited line range.  Line numbers start
-      with 1. The man pages have details.
+      with 1. This parameter is mainly of interest to editing programs which
+      drive perltidy. The man pages have details.
 
     - Some fairly rare instances of incorrect spacing have been fixed.  The
       problem was that the tokenizer being overly conservative in marking
-      terms as possible filehandles. This cause the space after the possible
-      filehandle to be frozen to its input value in order not to introduce
-      an error in case Perl had to guess.  The problem was fixed by having the
-      tokenizer look ahead for operators which can eliminate the uncertainty.
-      To illustrate, in the following line the term ``$d`` was previouly
-      marked as a possible file handle, so no space was added after it.
+      terms as possible filehandles or indirect objects. This causes the space
+      after the possible filehandle to be frozen to its input value in order not
+      to introduce an error in case Perl had to guess.  The problem was fixed
+      by having the tokenizer look ahead for operators which can eliminate the
+      uncertainty.  To illustrate, in the following line the term ``$d`` was
+      previously marked as a possible filehandle, so no space was added after it.
 
           print $d== 1 ? " [ON]\n" : $d ? " [$d]\n" : "\n";
+                  ^
 
       In the current version, the next token is seen to be an equality, so
       ``$d`` is marked as an ordinary identifier and normal spacing rules
       can apply:
 
           print $d == 1 ? " [ON]\n" : $d ? " [$d]\n" : "\n";
+                  ^
 
     - This version runs 7 to 10 percent faster than the previous release on
-      large files, depending on options and file type.
+      large files, depending on options and file type. Much of the gain comes
+      from streamlined I/O operations.
+
+    - This version was stress-tested for many cpu hours with random
+      input parameters. No failures to converge, internal fault checks,
+      undefined variable references or other irregularities were seen.
+
 
 ## 2023 07 01
 
index 606e7d82e46c0e61ac3947875fc8a17d983792cc..0ba47c79971d9c2e862c3b3c91610b666fc7d20f 100755 (executable)
@@ -3768,7 +3768,7 @@ block, with one or more commas.  These parameters only apply to something that
 fits this definition of a list.
 
 Note that a paren-less list of parameters is not a list by this definition, so
-these parameters have no effect on a peren-less list.
+these parameters have no effect on a paren-less list.
 
 Another consequence is that if the only comma in a list is deleted, then it
 cannot later be added back with these parameters because the container no
@@ -3861,73 +3861,82 @@ commas are removed.
 
 =head2 Missing Else Blocks
 
-One defensive programming technique is to require that every B<if-elsif->
-chain be terminated with an B<else> block, even though it is not required,
-to insure that there are no holes in the logic.
+A defensive programming technique is to require that every B<if-elsif-> chain
+be terminated with an B<else> block, even though it is not strictly required.
+This helps insure that there are no holes in the logic.
 
-For example, consider the following snippet: 
+For example, consider the following snippet:
 
-    if    ( $level == 3 ) { $val = $global{'section'} }
-    elsif ( $level == 2 ) { $val = $global{'chapter'} }
+    my $type = get_cards();
+    if    ( $type = 1 ) { action("hold 'em") }
+    elsif ( $type = 2 ) { action("fold 'em") }
+    elsif ( $type = 3 ) { action("walk away") }
 
-What if the variable B<$level> is neither 2 nor 3?  Maybe the original
-programmer knew that this was okay, but a new programmer might be unsure.
+What if the variable B<$type> is some other value?  It might have been obvious
+that this was okay when the code was first written, but it might not be so
+clear when the code is reviewed a few years later.  A terminal B<else> block
+with a comment would help clarify things.
 
-Perltidy has always written this information in its B<LOG> file (search for
-B<No else block>).  But a problem is that you have to turn on the log file and
-look for it. The parameters in this section can either issue a warning if an
-B<else> is missing, or even insert an empty B<else> block where one is missing,
-or both.
+The parameters in this section can help by either issuing a warning if an
+B<else> is missing, or even inserting an empty B<else> block where one is
+missing, or both.
 
 =over 4
 
 =item B<-wme>,  B<--warn-missing-else>
 
-This flag tells perltidy to issue a warning if a program is missing a terminal B<else> block.  The default is not to issue such warnings.
+This flag tells perltidy to issue a warning if a program is missing a terminal B<else> block.  The default is not to issue such a warning.
 
 =item B<-ame>,  B<--add-missing-else>
 
 This flag tells perltidy to output an empty else block wherever a program is
-missing a terminal B<else> block.  To get a warning when this is done you can
-also set B<-wme>.  The default is not to add missing else blocks.
+missing a terminal B<else> block.  To get a warning when this is done you
+should also set B<-wme>.  The default is not to add missing else blocks.
 
 =item B<-amec=s>,  B<--add-missing-else-comment=s>
 
-This string is an optional side comment which will be placed within a new empty else block. The default is:
+This string is a side comment which will be written to highlight a
+new empty else block. The default is:
 
     -amec='##FIXME - added with perltidy -ame'
 
 =back
 
-For example, on the above example we get
+For example, on the above example we can add a missing else and also get
+a warning notice with:
 
     # perltidy -ame -wme
-    if    ( $level == 3 ) { $val = $global{'section'} }
-    elsif ( $level == 2 ) { $val = $global{'chapter'} }
+    my $type = get_cards();
+    if    ( $type == 1 ) { action("hold 'em") }
+    elsif ( $type == 2 ) { action("fold 'em") }
+    elsif ( $type == 3 ) { action("walk away") }
     else {
         ##FIXME - added with perltidy -ame
     }
 
-Any B<##FIXME> comments should be changed appropriately after the code is
-inspected. For example, we might decide that it fine as is, and just leave
-a note for the next programmer:
+Any B<##FIXME> comments created in this way should be reviewed and changed
+appropriately. For example, one might decide that the code fine as is, and just
+change the comment to indicate that nothing has been overlooked:
 
-    if    ( $level == 3 ) { $val = $global{'section'} }
-    elsif ( $level == 2 ) { $val = $global{'chapter'} }
+    my $type = get_cards();
+    if    ( $type == 1 ) { action("hold 'em") }
+    elsif ( $type == 2 ) { action("fold 'em") }
+    elsif ( $type == 3 ) { action("walk away") }
     else {
-        # ok - other $level values can be safely ignored
+        # ok - no worries
     }
 
-Or maybe it should never happen:
+Or maybe a deeper analysis reveals that something was missed:
 
-    if    ( $level == 3 ) { $val = $global{'section'} }
-    elsif ( $level == 2 ) { $val = $global{'chapter'} }
-    else {
-        die("unexpected value of level=$level\n);
-    }
+    my $type = get_cards();
+    if    ( $type == 1 ) { action("hold 'em") }
+    elsif ( $type == 2 ) { action("fold 'em") }
+    elsif ( $type == 3 ) { action("walk away") }
+    else                 { action("run") }
 
-Note that this operation cannot be undone, so be careful to inspect the new
-code carefully.
+Sometimes it turns out that the else block should not reachable, in which case
+an error exit might be appropriate. In any case, having the B<else> block can
+improve code maintainability.
 
 =head2 Retaining or Ignoring Existing Line Breaks
 
@@ -5753,24 +5762,24 @@ dot is added, and the backup file will be F<somefile.pl~>  .
 The following list shows all short parameter names which allow a prefix
 'n' to produce the negated form:
 
- D      anl    asbl   asc    ast    asu    atc    atnl   aws    b
- baa    baao   bar    bbao   bbb    bbc    bbs    bl     bli    boa
- boc    bok    bol    bom    bos    bot    cblx   ce     conv   cpb
- cs     csc    cscb   cscw   dac    dbc    dbs    dcbl   dcsc   ddf
- dln    dnl    dop    dp     dpro   drc    dsc    dsm    dsn    dtc
- dtt    dwic   dwls   dwrs   dws    eos    f      fpva   frm    fs
- fso    gcs    hbc    hbcm   hbco   hbh    hbhh   hbi    hbj    hbk
- hbm    hbn    hbp    hbpd   hbpu   hbq    hbs    hbsc   hbv    hbw
- hent   hic    hicm   hico   hih    hihh   hii    hij    hik    him
- hin    hip    hipd   hipu   hiq    his    hisc   hiv    hiw    hsc
- html   ibc    icb    icp    iob    ipc    isbc   iscl   kgb    kgbd
- kgbi   kis    lal    log    lop    lp     lsl    mem    nib    ohbr
- okw    ola    olc    oll    olq    opr    opt    osbc   osbr   otr
- ple    pod    pvl    q      sac    sbc    sbl    scbb   schb   scp
- scsb   sct    se     sfp    sfs    skp    sob    sobb   sohb   sop
- sosb   sot    ssc    st     sts    t      tac    tbc    toc    tp
- tqw    trp    ts     tsc    tso    vbc    vc     viu    vmll   vsc
w      wfc    wn     x      xbt    xci    xlp    xs
+ D      ame    anl    asbl   asc    ast    asu    atc    atnl   aws
+ b      baa    baao   bar    bbao   bbb    bbc    bbs    bl     bli
+ boa    boc    bok    bol    bom    bos    bot    cblx   ce     conv
+ cpb    cs     csc    cscb   cscw   dac    dbc    dbs    dcbl   dcsc
+ ddf    dln    dnl    dop    dp     dpro   drc    dsc    dsm    dsn
+ dtc    dtt    dwic   dwls   dwrs   dws    eos    f      fpva   frm
+ fs     fso    gcs    hbc    hbcm   hbco   hbh    hbhh   hbi    hbj
+ hbk    hbm    hbn    hbp    hbpd   hbpu   hbq    hbs    hbsc   hbv
+ hbw    hent   hic    hicm   hico   hih    hihh   hii    hij    hik
+ him    hin    hip    hipd   hipu   hiq    his    hisc   hiv    hiw
+ hsc    html   ibc    icb    icp    iob    ipc    isbc   iscl   kgb
+ kgbd   kgbi   kis    lal    log    lop    lp     lsl    mem    nib
+ ohbr   okw    ola    olc    oll    olq    opr    opt    osbc   osbr
+ otr    ple    pod    pvl    q      sac    sbc    sbl    scbb   schb
+ scp    scsb   sct    se     sfp    sfs    skp    sob    sobb   sohb
+ sop    sosb   sot    ssc    st     sts    t      tac    tbc    toc
+ tp     tqw    trp    ts     tsc    tso    vbc    vc     viu    vmll
vsc    w      wfc    wme    wn     x      xbt    xci    xlp    xs
 
 Equivalently, the prefix 'no' or 'no-' on the corresponding long names may be
 used.
@@ -5869,7 +5878,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module
 
 =head1 VERSION
 
-This man page documents perltidy version 20230701.04
+This man page documents perltidy version 20230909
 
 =head1 BUG REPORTS
 
index 2a2ecc57402ad2e6e51b396fc7cdbc08fb975143..890dde2e3158afaf21e3aecbb509e1aacf4984ac 100644 (file)
@@ -1,12 +1,12 @@
 <h1>Perltidy Change Log</h1>
 
-<h2>2023 07 01.04</h2>
+<h2>2023 09 09</h2>
 
-<pre><code>- Add parameters -wme, or --warn-missing-else, and -ame,
+<pre><code>- Added new parameters -wme, or --warn-missing-else, and -ame,
   or --add-missing else.  The parameter -wme tells perltidy to issue
-  a warning to the error output if an if-elsif-elsif-... chain does
-  not end in an else block.  The parameter -ame tells perltidy to
-  insert an else block at the end of such a chain if there is none.
+  a warning if an if-elsif-... chain does not end in an else block.
+  The parameter -ame tells perltidy to insert an else block at the
+  end of such a chain if there is none.
 
   For example, given the following snippet:
 
         ##FIXME - added with perltidy -ame
     }
 
-  The resulting code should be carefully reviewed, and the comment should
-  be updated as appropriate.  The comment can be changed with parameter
-  -amec=s, where 's' is the comment in the else block.  The man pages
-  have more details.
+  The resulting code should be carefully reviewed, and the ##FIXME comment
+  should be updated as appropriate.  The text of the ##FIXME comment can be
+  changed with parameter -amec=s, where 's' is the comment to mark the new
+  else block. The man pages have more details.
 
 - The syntax of the parameter --use-feature=class, or -uf=class, which
   new in the previous release, has been changed slightly for clarity.
 
 - Issue git #122. Added parameter -lrt=n1:n2, or --line-range-tidy=n1:n2
   to limit tidy operations to a limited line range.  Line numbers start
-  with 1. The man pages have details.
+  with 1. This parameter is mainly of interest to editing programs which
+  drive perltidy. The man pages have details.
 
 - Some fairly rare instances of incorrect spacing have been fixed.  The
   problem was that the tokenizer being overly conservative in marking
-  terms as possible filehandles. This cause the space after the possible
-  filehandle to be frozen to its input value in order not to introduce
-  an error in case Perl had to guess.  The problem was fixed by having the
-  tokenizer look ahead for operators which can eliminate the uncertainty.
-  To illustrate, in the following line the term ``$d`` was previouly
-  marked as a possible file handle, so no space was added after it.
+  terms as possible filehandles or indirect objects. This causes the space
+  after the possible filehandle to be frozen to its input value in order not
+  to introduce an error in case Perl had to guess.  The problem was fixed
+  by having the tokenizer look ahead for operators which can eliminate the
+  uncertainty.  To illustrate, in the following line the term ``$d`` was
+  previously marked as a possible filehandle, so no space was added after it.
 
       print $d== 1 ? " [ON]\n" : $d ? " [$d]\n" : "\n";
+              ^
 
   In the current version, the next token is seen to be an equality, so
   ``$d`` is marked as an ordinary identifier and normal spacing rules
   can apply:
 
       print $d == 1 ? " [ON]\n" : $d ? " [$d]\n" : "\n";
+              ^
 
 - This version runs 7 to 10 percent faster than the previous release on
-  large files, depending on options and file type.
+  large files, depending on options and file type. Much of the gain comes
+  from streamlined I/O operations.
+
+- This version was stress-tested for many cpu hours with random
+  input parameters. No failures to converge, internal fault checks,
+  undefined variable references or other irregularities were seen.
 </code></pre>
 
 <h2>2023 07 01</h2>
index 3a2e9e9ab0343f42ca6a85b01235fccb634deaa4..08176cfdf755498be1b00794e9ebcf2a029f323b 100644 (file)
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents Perl::Tidy version 20230701.04</p>
+<p>This man page documents Perl::Tidy version 20230909</p>
 
 <h1 id="LICENSE">LICENSE</h1>
 
index 1664dcec6985fa3bbfd34a8b974cf783e7c0adf9..a8529626e078184bf304d79ac96af48b22f78742 100644 (file)
 
 <li><p>For the implementation of these parameters, a <b>list</b> is basically taken to be a container of items (parens, square brackets, or braces), which is not a code block, with one or more commas. These parameters only apply to something that fits this definition of a list.</p>
 
-<p>Note that a paren-less list of parameters is not a list by this definition, so these parameters have no effect on a peren-less list.</p>
+<p>Note that a paren-less list of parameters is not a list by this definition, so these parameters have no effect on a paren-less list.</p>
 
 <p>Another consequence is that if the only comma in a list is deleted, then it cannot later be added back with these parameters because the container no longer fits this definition of a list. For example, given</p>
 
 
 <h2 id="Missing-Else-Blocks">Missing Else Blocks</h2>
 
-<p>One defensive programming technique is to require that every <b>if-elsif-</b> chain be terminated with an <b>else</b> block, even though it is not required, to insure that there are no holes in the logic.</p>
+<p>A defensive programming technique is to require that every <b>if-elsif-</b> chain be terminated with an <b>else</b> block, even though it is not strictly required. This helps insure that there are no holes in the logic.</p>
 
 <p>For example, consider the following snippet:</p>
 
-<pre><code>    if    ( $level == 3 ) { $val = $global{&#39;section&#39;} }
-    elsif ( $level == 2 ) { $val = $global{&#39;chapter&#39;} }</code></pre>
+<pre><code>    my $type = get_cards();
+    if    ( $type = 1 ) { action(&quot;hold &#39;em&quot;) }
+    elsif ( $type = 2 ) { action(&quot;fold &#39;em&quot;) }
+    elsif ( $type = 3 ) { action(&quot;walk away&quot;) }</code></pre>
 
-<p>What if the variable <b>$level</b> is neither 2 nor 3? Maybe the original programmer knew that this was okay, but a new programmer might be unsure.</p>
+<p>What if the variable <b>$type</b> is some other value? It might have been obvious that this was okay when the code was first written, but it might not be so clear when the code is reviewed a few years later. A terminal <b>else</b> block with a comment would help clarify things.</p>
 
-<p>Perltidy has always written this information in its <b>LOG</b> file (search for <b>No else block</b>). But a problem is that you have to turn on the log file and look for it. The parameters in this section can either issue a warning if an <b>else</b> is missing, or even insert an empty <b>else</b> block where one is missing, or both.</p>
+<p>The parameters in this section can help by either issuing a warning if an <b>else</b> is missing, or even inserting an empty <b>else</b> block where one is missing, or both.</p>
 
 <dl>
 
 <dt id="wme---warn-missing-else"><b>-wme</b>, <b>--warn-missing-else</b></dt>
 <dd>
 
-<p>This flag tells perltidy to issue a warning if a program is missing a terminal <b>else</b> block. The default is not to issue such warnings.</p>
+<p>This flag tells perltidy to issue a warning if a program is missing a terminal <b>else</b> block. The default is not to issue such a warning.</p>
 
 </dd>
 <dt id="ame---add-missing-else"><b>-ame</b>, <b>--add-missing-else</b></dt>
 <dd>
 
-<p>This flag tells perltidy to output an empty else block wherever a program is missing a terminal <b>else</b> block. To get a warning when this is done you can also set <b>-wme</b>. The default is not to add missing else blocks.</p>
+<p>This flag tells perltidy to output an empty else block wherever a program is missing a terminal <b>else</b> block. To get a warning when this is done you should also set <b>-wme</b>. The default is not to add missing else blocks.</p>
 
 </dd>
 <dt id="amec-s---add-missing-else-comment-s"><b>-amec=s</b>, <b>--add-missing-else-comment=s</b></dt>
 <dd>
 
-<p>This string is an optional side comment which will be placed within a new empty else block. The default is:</p>
+<p>This string is a side comment which will be written to highlight a new empty else block. The default is:</p>
 
 <pre><code>    -amec=&#39;##FIXME - added with perltidy -ame&#39;</code></pre>
 
 </dd>
 </dl>
 
-<p>For example, on the above example we get</p>
+<p>For example, on the above example we can add a missing else and also get a warning notice with:</p>
 
 <pre><code>    # perltidy -ame -wme
-    if    ( $level == 3 ) { $val = $global{&#39;section&#39;} }
-    elsif ( $level == 2 ) { $val = $global{&#39;chapter&#39;} }
+    my $type = get_cards();
+    if    ( $type == 1 ) { action(&quot;hold &#39;em&quot;) }
+    elsif ( $type == 2 ) { action(&quot;fold &#39;em&quot;) }
+    elsif ( $type == 3 ) { action(&quot;walk away&quot;) }
     else {
         ##FIXME - added with perltidy -ame
     }</code></pre>
 
-<p>Any <b>##FIXME</b> comments should be changed appropriately after the code is inspected. For example, we might decide that it fine as is, and just leave a note for the next programmer:</p>
+<p>Any <b>##FIXME</b> comments created in this way should be reviewed and changed appropriately. For example, one might decide that the code fine as is, and just change the comment to indicate that nothing has been overlooked:</p>
 
-<pre><code>    if    ( $level == 3 ) { $val = $global{&#39;section&#39;} }
-    elsif ( $level == 2 ) { $val = $global{&#39;chapter&#39;} }
+<pre><code>    my $type = get_cards();
+    if    ( $type == 1 ) { action(&quot;hold &#39;em&quot;) }
+    elsif ( $type == 2 ) { action(&quot;fold &#39;em&quot;) }
+    elsif ( $type == 3 ) { action(&quot;walk away&quot;) }
     else {
-        # ok - other $level values can be safely ignored
+        # ok - no worries
     }</code></pre>
 
-<p>Or maybe it should never happen:</p>
+<p>Or maybe a deeper analysis reveals that something was missed:</p>
 
-<pre><code>    if    ( $level == 3 ) { $val = $global{&#39;section&#39;} }
-    elsif ( $level == 2 ) { $val = $global{&#39;chapter&#39;} }
-    else {
-        die(&quot;unexpected value of level=$level\n);
-    }</code></pre>
+<pre><code>    my $type = get_cards();
+    if    ( $type == 1 ) { action(&quot;hold &#39;em&quot;) }
+    elsif ( $type == 2 ) { action(&quot;fold &#39;em&quot;) }
+    elsif ( $type == 3 ) { action(&quot;walk away&quot;) }
+    else                 { action(&quot;run&quot;) }</code></pre>
 
-<p>Note that this operation cannot be undone, so be careful to inspect the new code carefully.</p>
+<p>Sometimes it turns out that the else block should not reachable, in which case an error exit might be appropriate. In any case, having the <b>else</b> block can improve code maintainability.</p>
 
 <h2 id="Retaining-or-Ignoring-Existing-Line-Breaks">Retaining or Ignoring Existing Line Breaks</h2>
 
 
 <p>The following list shows all short parameter names which allow a prefix &#39;n&#39; to produce the negated form:</p>
 
-<pre><code> D      anl    asbl   asc    ast    asu    atc    atnl   aws    b
- baa    baao   bar    bbao   bbb    bbc    bbs    bl     bli    boa
- boc    bok    bol    bom    bos    bot    cblx   ce     conv   cpb
- cs     csc    cscb   cscw   dac    dbc    dbs    dcbl   dcsc   ddf
- dln    dnl    dop    dp     dpro   drc    dsc    dsm    dsn    dtc
- dtt    dwic   dwls   dwrs   dws    eos    f      fpva   frm    fs
- fso    gcs    hbc    hbcm   hbco   hbh    hbhh   hbi    hbj    hbk
- hbm    hbn    hbp    hbpd   hbpu   hbq    hbs    hbsc   hbv    hbw
- hent   hic    hicm   hico   hih    hihh   hii    hij    hik    him
- hin    hip    hipd   hipu   hiq    his    hisc   hiv    hiw    hsc
- html   ibc    icb    icp    iob    ipc    isbc   iscl   kgb    kgbd
- kgbi   kis    lal    log    lop    lp     lsl    mem    nib    ohbr
- okw    ola    olc    oll    olq    opr    opt    osbc   osbr   otr
- ple    pod    pvl    q      sac    sbc    sbl    scbb   schb   scp
- scsb   sct    se     sfp    sfs    skp    sob    sobb   sohb   sop
- sosb   sot    ssc    st     sts    t      tac    tbc    toc    tp
- tqw    trp    ts     tsc    tso    vbc    vc     viu    vmll   vsc
w      wfc    wn     x      xbt    xci    xlp    xs</code></pre>
+<pre><code> D      ame    anl    asbl   asc    ast    asu    atc    atnl   aws
+ b      baa    baao   bar    bbao   bbb    bbc    bbs    bl     bli
+ boa    boc    bok    bol    bom    bos    bot    cblx   ce     conv
+ cpb    cs     csc    cscb   cscw   dac    dbc    dbs    dcbl   dcsc
+ ddf    dln    dnl    dop    dp     dpro   drc    dsc    dsm    dsn
+ dtc    dtt    dwic   dwls   dwrs   dws    eos    f      fpva   frm
+ fs     fso    gcs    hbc    hbcm   hbco   hbh    hbhh   hbi    hbj
+ hbk    hbm    hbn    hbp    hbpd   hbpu   hbq    hbs    hbsc   hbv
+ hbw    hent   hic    hicm   hico   hih    hihh   hii    hij    hik
+ him    hin    hip    hipd   hipu   hiq    his    hisc   hiv    hiw
+ hsc    html   ibc    icb    icp    iob    ipc    isbc   iscl   kgb
+ kgbd   kgbi   kis    lal    log    lop    lp     lsl    mem    nib
+ ohbr   okw    ola    olc    oll    olq    opr    opt    osbc   osbr
+ otr    ple    pod    pvl    q      sac    sbc    sbl    scbb   schb
+ scp    scsb   sct    se     sfp    sfs    skp    sob    sobb   sohb
+ sop    sosb   sot    ssc    st     sts    t      tac    tbc    toc
+ tp     tqw    trp    ts     tsc    tso    vbc    vc     viu    vmll
vsc    w      wfc    wme    wn     x      xbt    xci    xlp    xs</code></pre>
 
 <p>Equivalently, the prefix &#39;no&#39; or &#39;no-&#39; on the corresponding long names may be used.</p>
 
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents perltidy version 20230701.04</p>
+<p>This man page documents perltidy version 20230909</p>
 
 <h1 id="BUG-REPORTS">BUG REPORTS</h1>
 
index f5a1fc673e0263d6cf87375957dcf6bf1f68935d..c853fc7b1bfe178e3f283ec1934564e6afaa2cfc 100644 (file)
@@ -111,7 +111,7 @@ BEGIN {
     # then the Release version must be bumped, and it is probably past time for
     # a release anyway.
 
-    $VERSION = '20230701.04';
+    $VERSION = '20230909';
 } ## end BEGIN
 
 sub DESTROY {
index 65ad5014e6f83d28096ab8d2dc73885621ec3705..d420dc8c809d44cdff5772e39d7bee68cd5ba5c6 100644 (file)
@@ -469,7 +469,7 @@ The module 'Perl::Tidy' comes with a binary 'perltidy' which is installed when t
 
 =head1 VERSION
 
-This man page documents Perl::Tidy version 20230701.04
+This man page documents Perl::Tidy version 20230909
 
 =head1 LICENSE
 
index 8e1a3fe60a6c28c6811fcdff909b007b62803b4b..ffba2cecba2625028d701249e358be2bdcd262c3 100644 (file)
@@ -8,7 +8,7 @@ package Perl::Tidy::Debugger;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 use constant EMPTY_STRING => q{};
 use constant SPACE        => q{ };
index 6a16e97833625ae0bb29ea44145249b9519b0cd9..e1dbb90a46b9aebae910313746ca6fa8b0a6f38d 100644 (file)
@@ -18,7 +18,7 @@ package Perl::Tidy::Diagnostics;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 use constant EMPTY_STRING => q{};
 
index 0250311e0ff789376e583796525ddc80ef5fde04..877ff0c7bd65e2b9cd3b2bd6eefa743f61f30ded 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::FileWriter;
 use strict;
 use warnings;
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 use constant DEVEL_MODE   => 0;
 use constant EMPTY_STRING => q{};
index e1d5907d7d783665f0f411bd90e2f4aea4d72c6c..aeb77367117088b89b9ded80d52af71f40196449 100644 (file)
@@ -53,7 +53,7 @@ use constant SPACE        => q{ };
 use Carp;
 use English    qw( -no_match_vars );
 use List::Util qw( min max first );    # min, max first are in Perl 5.8
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 # The Tokenizer will be loaded with the Formatter
 ##use Perl::Tidy::Tokenizer;    # for is_keyword()
index 157b670e735ed53828afa505fdb93547abc7563e..4ed4ead85d404facb974658e885aceeaad89d425 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::HtmlWriter;
 use strict;
 use warnings;
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 use English qw( -no_match_vars );
 use File::Basename;
index 1c2a4147cfccfcb63864cb024a9cf7742c874b22..f1d6cc851a3fbc447b8951f546d08136be8a247b 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 use constant DEVEL_MODE   => 0;
 use constant EMPTY_STRING => q{};
index 2c4628862a90826539529f908ef3661d9d7e3c1a..be5531e6669eda68bf5e67150b4de6ed70db9b46 100644 (file)
@@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 use constant DEVEL_MODE => 0;
 
index d444b5e266d4cc205618643f0732f3ae0d23c942..a9a8b86a15d711d7e4444e8b7134edfb0b97a946 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::IndentationItem;
 use strict;
 use warnings;
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 BEGIN {
 
index aa23eaa8b3dd1be46116869d8ca4e1de493c69f9..27ad2d72703d279e4cff60b3b243aa36dc6c715e 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::Logger;
 use strict;
 use warnings;
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 use English qw( -no_match_vars );
 
 use constant DEVEL_MODE   => 0;
index a2c64c755e1908440f65a8157309007cbaba1b57..ea3b88b96bb5e847d1185892833a344a14f16ae6 100644 (file)
@@ -22,7 +22,7 @@ use strict;
 use warnings;
 use English qw( -no_match_vars );
 
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 use Carp;
 
@@ -125,6 +125,7 @@ my (
     $code_skipping_pattern_begin,
     $code_skipping_pattern_end,
     $rOpts_code_skipping,
+    $rOpts_code_skipping_begin,
     %is_END_DATA_format_sub,
     %is_grep_alias,
     %is_sub,
@@ -409,7 +410,8 @@ sub check_options {
         @{is_grep_alias}{@q} = (1) x scalar(@q);
     }
 
-    $rOpts_code_skipping = $rOpts->{'code-skipping'};
+    $rOpts_code_skipping       = $rOpts->{'code-skipping'};
+    $rOpts_code_skipping_begin = $rOpts->{'code-skipping-begin'};
     $code_skipping_pattern_begin =
       make_code_skipping_pattern( $rOpts, 'code-skipping-begin', '#<<V' );
     $code_skipping_pattern_end =
@@ -5160,17 +5162,35 @@ EOM
                 $input_line = EMPTY_STRING;
             }
 
-            $is_END_or_DATA = substr( $input_line, 0, 1 ) eq '_'
-              && $input_line =~ /^__(END|DATA)__\s*$/;
         }
 
-        # Optimize for a full-line comment.
         if ( !$in_quote ) {
+
+            # Optimize handling of a blank line
+            if ( !length($input_line) ) {
+                $line_of_tokens->{_line_type}        = 'CODE';
+                $line_of_tokens->{_rtokens}          = [];
+                $line_of_tokens->{_rtoken_type}      = [];
+                $line_of_tokens->{_rlevels}          = [];
+                $line_of_tokens->{_rci_levels}       = [];
+                $line_of_tokens->{_rblock_type}      = [];
+                $line_of_tokens->{_nesting_tokens_0} = $nesting_token_string;
+                $line_of_tokens->{_nesting_blocks_0} = $nesting_block_string;
+                return;
+            }
+
+            # Check comments
             if ( substr( $input_line, 0, 1 ) eq '#' ) {
 
                 # and check for skipped section
-                if (   $rOpts_code_skipping
-                    && $input_line =~ /$code_skipping_pattern_begin/ )
+                if (
+                    (
+                        substr( $input_line, 0, 4 ) eq '#<<V'
+                        || $rOpts_code_skipping_begin
+                    )
+                    && $rOpts_code_skipping
+                    && $input_line =~ /$code_skipping_pattern_begin/
+                  )
                 {
                     $self->[_in_skipped_] = $self->[_last_line_number_];
                     return;
@@ -5188,17 +5208,11 @@ EOM
                 return;
             }
 
-            # Optimize handling of a blank line
-            if ( !length($input_line) ) {
-                $line_of_tokens->{_line_type}        = 'CODE';
-                $line_of_tokens->{_rtokens}          = [];
-                $line_of_tokens->{_rtoken_type}      = [];
-                $line_of_tokens->{_rlevels}          = [];
-                $line_of_tokens->{_rci_levels}       = [];
-                $line_of_tokens->{_rblock_type}      = [];
-                $line_of_tokens->{_nesting_tokens_0} = $nesting_token_string;
-                $line_of_tokens->{_nesting_blocks_0} = $nesting_block_string;
-                return;
+            # Look for __END__ or __DATA__ lines
+            if ( substr( $input_line, 0, 1 ) eq '_'
+                && $input_line =~ /^__(END|DATA)__\s*$/ )
+            {
+                $is_END_or_DATA = 1;
             }
         }
 
index 3d676a0ff5ea6c9c69e74629c600854d09978f3f..77385063199c45a22de9c6b6065f0a65aefa43e0 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 use Carp;
 use English qw( -no_match_vars );
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 use Perl::Tidy::VerticalAligner::Alignment;
 use Perl::Tidy::VerticalAligner::Line;
 
index 7b8798a70471b75906bdb7d77e542426ad6678a5..7b66141542d18c5826363572472a29392e1b4fb0 100644 (file)
@@ -10,7 +10,7 @@ use warnings;
 
 { #<<< A non-indenting brace
 
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 sub new {
     my ( $class, $rarg ) = @_;
index 97bca6b31f64d36e858c641ee4496ebda99c3371..3452e35369d8bc847d8305e9ecaa66384c87fa19 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::VerticalAligner::Line;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20230701.04';
+our $VERSION = '20230909';
 
 sub AUTOLOAD {