From 24aa60dbe8d5b4d65d3dc5fea8dec39c0b4632e1 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Wed, 25 Sep 2024 17:19:24 -0700 Subject: [PATCH] bump version to 20240903.03 --- CHANGES.md | 2 +- bin/perltidy | 2 +- docs/ChangeLog.html | 15 +- docs/Tidy.html | 2 +- docs/perltidy.html | 187 +++++++++++++-------- lib/Perl/Tidy.pm | 2 +- lib/Perl/Tidy.pod | 2 +- lib/Perl/Tidy/Debugger.pm | 2 +- lib/Perl/Tidy/Diagnostics.pm | 2 +- lib/Perl/Tidy/FileWriter.pm | 2 +- lib/Perl/Tidy/Formatter.pm | 2 +- lib/Perl/Tidy/HtmlWriter.pm | 2 +- lib/Perl/Tidy/IOScalar.pm | 2 +- lib/Perl/Tidy/IOScalarArray.pm | 2 +- lib/Perl/Tidy/IndentationItem.pm | 2 +- lib/Perl/Tidy/Logger.pm | 2 +- lib/Perl/Tidy/Tokenizer.pm | 2 +- lib/Perl/Tidy/VerticalAligner.pm | 7 +- lib/Perl/Tidy/VerticalAligner/Alignment.pm | 2 +- lib/Perl/Tidy/VerticalAligner/Line.pm | 2 +- 20 files changed, 154 insertions(+), 89 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 600da5ce..9e3ee603 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # Perltidy Change Log -## 2024 09 03.02 +## 2024 09 03.03 - The parameter --add-lone-trailing-commas, -altc, is now on by default. This will simplify input for trailing comma operations. Use diff --git a/bin/perltidy b/bin/perltidy index 1e2cba5b..d6959c28 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -7083,7 +7083,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module =head1 VERSION -This man page documents perltidy version 20240903.02 +This man page documents perltidy version 20240903.03 =head1 BUG REPORTS diff --git a/docs/ChangeLog.html b/docs/ChangeLog.html index 87ffcf9c..9f030570 100644 --- a/docs/ChangeLog.html +++ b/docs/ChangeLog.html @@ -1,8 +1,19 @@

Perltidy Change Log

-

2024 09 03.01

+

2024 09 03.03

-
- Added parameter --qw-as-function, or -qwaf, discussed in git #164.
+
- The parameter --add-lone-trailing-commas, -altc, is now on by default.
+This will simplify input for trailing comma operations. Use
+--noadd-lone-trailing-commas, or -naltc to turn it off.
+
+- More edge cases for adding and deleting trailing commas are now handled
+(git #156).
+
+- A problem has been fixed in which the addition or deletion of trailing
+commas with the -atc or -dtc flags did not occur due to early convergence
+when the -conv flag was set (git #143).
+
+- Added parameter --qw-as-function, or -qwaf, discussed in git #164.
 When this parameter is set, a qw list which begins with 'qw(' is
 formatted as if it were a function call with call args being a list
 of comma-separated quoted items. For example, given this input:
diff --git a/docs/Tidy.html b/docs/Tidy.html
index 5da3a956..d1b3df75 100644
--- a/docs/Tidy.html
+++ b/docs/Tidy.html
@@ -399,7 +399,7 @@
 
 

VERSION

-

This man page documents Perl::Tidy version 20240903.01

+

This man page documents Perl::Tidy version 20240903.03

LICENSE

diff --git a/docs/perltidy.html b/docs/perltidy.html index 149ef4f1..dccd90f7 100644 --- a/docs/perltidy.html +++ b/docs/perltidy.html @@ -615,7 +615,7 @@

This flag allows perltidy to use some improvements which have been made to its indentation model. One of the things it does is "extend" continuation indentation deeper into structures, hence the name. The improved indentation is particularly noticeable when the flags -ci=n and -i=n use the same value of n. There are no significant disadvantages to using this flag, but to avoid disturbing existing formatting the default is not to use it, -nxci.

-

Please see the section "-pbp, --perl-best-practices" for an example of how this flag can improve the formatting of ternary statements. It can also improve indentation of some multi-line qw lists as shown below.

+

Please see the section "-pbp, --perl-best-practices" for an example of how this flag can improve the formatting of ternary statements. It can also improve indentation of some multiline qw lists as shown below.

            # perltidy
             foreach $color (
@@ -701,7 +701,7 @@
 
 
    -
  • A limitation on -lp, but not -xlp, occurs in situations where perltidy does not have complete freedom to choose line breaks. Then it may temporarily revert to its default indentation method. This can occur for example if there are blank lines, block comments, multi-line quotes, or side comments between the opening and closing parens, braces, or brackets. It will also occur if a multi-line anonymous sub occurs within a container since that will impose specific line breaks (such as line breaks after statements).

    +
  • A limitation on -lp, but not -xlp, occurs in situations where perltidy does not have complete freedom to choose line breaks. Then it may temporarily revert to its default indentation method. This can occur for example if there are blank lines, block comments, multiline quotes, or side comments between the opening and closing parens, braces, or brackets. It will also occur if a multiline anonymous sub occurs within a container since that will impose specific line breaks (such as line breaks after statements).

  • For both the -lp and -xlp flags, any parameter which significantly restricts the ability of perltidy to choose newlines will conflict with these flags and will cause them to be deactivated. These include --indent-only, --freeze-newlines, -noadd-newlines, and -nodelete-old-newlines.

    @@ -1415,9 +1415,9 @@
    Trimming whitespace around qw quotes
    -

    -tqw or --trim-qw provide the default behavior of trimming spaces around multi-line qw quotes and indenting them appropriately.

    +

    -tqw or --trim-qw provide the default behavior of trimming spaces around multiline qw quotes and indenting them appropriately.

    -

    -ntqw or --notrim-qw cause leading and trailing whitespace around multi-line qw quotes to be left unchanged. This option will not normally be necessary, but was added for testing purposes, because in some versions of perl, trimming qw quotes changes the syntax tree.

    +

    -ntqw or --notrim-qw cause leading and trailing whitespace around multiline qw quotes to be left unchanged. This option will not normally be necessary, but was added for testing purposes, because in some versions of perl, trimming qw quotes changes the syntax tree.

    -sbq=n or --space-backslash-quote=n
    @@ -3100,11 +3100,11 @@
    --want-trailing-commas=s or -wtc=s, --add-trailing-commas or -atc, and --delete-trailing-commas or -dtc
    -

    A trailing comma is a comma following the last item of a list. Perl allows trailing commas but they are not required. Including them can sometimes simplify the maintenance of large or complex lists. By default, perltidy does not add or delete trailing commas, but it is possible to manipulate them with the following set of related parameters:

    +

    A trailing comma is a comma following the last item of a list. Perl allows trailing commas but they are not required. Including them can sometimes simplify the maintenance of large or complex lists, and help display structure. But they may not be appropriate in all lists, for example in a list which always has just one term. By default, perltidy does not add or delete trailing commas, but it is possible to manipulate them with the following set of related parameters:

      -
    • --want-trailing-commas=s, -wtc=s - defines where trailing commas are wanted

      +
    • --want-trailing-commas=s, -wtc=s - defines where trailing commas are wanted (the style)

    • --add-trailing-commas, -atc - gives permission to add trailing commas to match the style wanted

      @@ -3112,66 +3112,78 @@
    • --delete-trailing-commas, -dtc - gives permission to delete trailing commas which do not match the style wanted

      -
    • -
    • --add-lone-trailing-commas, -altc - gives permission to add a comma if it will be the only comma. This is off by default and explained below.

      - -
    • -
    • --delete-lone-trailing-commas, -dltc - gives permission to delete the only comma in a list. This is on by default and explained below.

      -

    The parameter --want-trailing-commas=s, or -wtc=s, defines a preferred style. The string s indicates which lists should get trailing commas, as follows:

    -
      s=0 : no list should have a trailing comma
    -  s=1 or * : every list should have a trailing comma
    -  s=m a multi-line list should have a trailing commas
    -  s=b trailing commas should be 'bare' (comma followed by newline)
    -  s=h lists of key=>value pairs, with about one one '=>' and one ',' per line,
    -      with a bare trailing comma
    -  s=i lists with about one comma per line, with a bare trailing comma
    +
      s=1 or '*' : every list
    +  s=m a multiline list
    +  s=b a multiline list with bare trailing comma
    +  s=i a multiline list with bare trailing comma and about one comma per line
    +  s=h a multiline list with bare trailing comma and about one key=>value pair per line
    +  s=0 : no list
    +
       s=' ' or -wtc not defined : leave trailing commas unchanged [DEFAULT].
    -

    This parameter by itself only indicates the where trailing commas are wanted. Perltidy only adds these trailing commas if the flag --add-trailing-commas, or -atc is set. And perltidy only removes unwanted trailing commas if the flag --delete-trailing-commas, or -dtc is set.

    +

    where:

    + +
      + +
    • A list here is basically taken to be a container of items (parens, square brackets, or braces), which is not a code block, which contains one or more commas or fat commas. These parameters only apply to something that fits this definition of a list.

      + +

      A paren-less list of parameters is not a list by this definition, so these parameters do not apply to a paren-less list.

      + +
    • +
    • A multiline list is a list for which the opening and closing brackets on different lines.

      + +
    • +
    • A bare trailing comma is a comma which is at the end of a line. That is, the closing container token follows on a different line. So a list with a bare trailing comma is a special case of a multiline list.

      + +
    • +
    + +

    This parameter by itself only indicates where trailing commas are wanted. Perltidy only adds these trailing commas if permission is granted by setting the flag --add-trailing-commas, or -atc. And perltidy only removes unwanted trailing commas if the flag --delete-trailing-commas, or -dtc is set.

    Here are some example parameter combinations and their meanings

      -wtc=0 -dtc   : delete all trailing commas
    -  -wtc=1 -atc   : all lists get trailing commas
    -  -wtc=m -atc   : all multi-line lists get trailing commas, but
    -                  single line lists remain unchanged.
    -  -wtc=m -dtc   : multi-line lists remain unchanged, but
    -                  any trailing commas on single line lists are removed.
    -  -wtc=m -atc -dtc  : all multi-line lists get trailing commas, and
    -                      any trailing commas on single line lists are removed.
    + -wtc=1 -atc : add trailing commas to all lists + -wtc=m -atc : add trailing commas to all multiline lists + (single line lists remain unchanged) + -wtc=b -atc : add commas as necessary so that all lists whose + closing bracket starts a new line have trailing commas + -wtc=b -dtc : all trailing commas which are not bare + (not followed by a newline) get deleted. + -wtc=b -atc -dtc : do both of the above operations so that + all trailing commas are bare
    -

    For example, given the following input without a trailing comma

    +

    For example, given the following input

    -
        bless {
    -        B    => $B,
    -        Root => $Root
    -    } => $package;
    +
        $wine_list = $top->Box(
    +        "-length" => 5,
    +        "-width"  => 3
    +    )->select( "red", "white", "gold", );
    -

    we can add a trailing comma after the variable $Root using

    +

    we have

    -
        # perltidy -wtc=m -atc
    -    bless {
    -        B    => $B,
    -        Root => $Root,
    -    } => $package;
    +
        # perltidy -wtc=b -atc -dtc
    +    $wine_list = $top->Box(
    +        "-length" => 5,
    +        "-width"  => 3,
    +    )->select( "red", "white", "gold" );
    -

    This could also be achieved in this case with -wtc=b instead of -wtc=m because the trailing comma here is bare (separated from its closing brace by a newline). And it could also be achieved with -wtc=h because this particular list is a list of key=>value pairs.

    +

    A comma was added after the 3, since it is bare, and a comma was removed after "gold", since it not bare.

    -

    The above styles should cover the main of situations of interest, but it is possible to apply a different style to each type of container token by including an opening token ahead of the style character in the above table. For example

    +

    It is possible to apply a different style to each type of container token by including an opening token ahead of the style character in the above table. For example

        -wtc='(m [b'
    -

    means that lists within parens should have multi-line trailing commas, and that lists within square brackets have bare trailing commas. Since there is no specification for curly braces in this example, their trailing commas would remain unchanged.

    +

    means that lists within parens should have multiline trailing commas, and that lists within square brackets have bare trailing commas. Since there is no specification for curly braces in this example, their trailing commas would remain unchanged.

    For parentheses, an additional item of information which can be given is an alphanumeric letter which is used to limit the selection further depending on the type of token immediately before the opening paren. The possible letters are currently 'k', 'K', 'f', 'F', 'w', and 'W', with these meanings for matching whatever precedes an opening paren:

     'k' matches if the previous nonblank token is a perl built-in keyword
    -     (such as 'if', 'while'),
      'K' matches if 'k' does not, meaning that the previous token is not a keyword.
      'f' matches if the previous token is a function other than a keyword.
      'F' matches if 'f' does not.
    @@ -3180,45 +3192,84 @@
     
     

    These are the same codes used for --line-up-parentheses-inclusion-list. For example,

    -
      -wtc = 'w(m'
    +
      -wtc='w(m'
    + +

    means that trailing commas are wanted for multiline parenthesized lists following a function call or keyword.

    + +

    Finally, a leading + can be placed on any term to indicate that it only applies when adding commas. A leading - indicates that it only applies when deleting commas. For example,

    -

    means that trailing commas are wanted for multi-line parenthesized lists following a function call or keyword.

    +
      -wtc='+h -b' -atc -dtc
    + +

    means that missing trailing commas should be added to lists of key => values pairs, and trailing commas which are not bare should be removed. No other changes are made. When both plus and minus terms are used like this, they must not be in conflict. This can be shown to be equivalent to requiring that the letter of the plus term does not occur before the letter of the minus term in their hierarchical order m, b, i, h. In this example, the plus term h follows the minus term b in the list, so there is no conflict.

    Some points to note regarding adding and deleting trailing commas:

      -
    • For the implementation of these parameters, a list 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 or fat commas. These parameters only apply to something that fits this definition of a list.

      +
    • It is recommended to also use the --converge parameter when adding and/or deleting trailing commas, especially if the formatter may be making other line break changes at the same time. The reason is that the decision regarding whether or not a list is multiline or bare is made based on the input stream if only one iteration is made, which is the default.

      -

      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.

      +

      When iterations are requested with the --converge parameter, any comma addition or deletion operations are postponed until the start of the second iteration, after most changes in line breaks have been made.

      -
    • -
    • By multiline list is meant a list for which the first comma and trailing comma are on different lines.

      +

      To illustrate, if we start with

      -
    • -
    • A bare trailing comma is a comma which is at the end of a line. That is, the closing container token follows on a different line. So a list with a bare trailing comma is a special case of a multi-line list.

      +
              f(
      +            a => 1,
      +            b => 2, );
      -
    • -
    • The decision regarding whether or not a list is multi-line or bare is made based on the input stream if only one iteration is made, which is the default.

      +

      and attempt to delete non-bare commas,

      + +
              # perltidy -wtc=b -dtc
      +        f(
      +            a => 1,
      +            b => 2
      +        );
      + +

      we delete a comma which has become bare, which is not what is wanted. This happened because the change was based on the starting rather than the final line breaks. Rerunning with --converge added fixes things

      -

      It can sometimes be preferable to base decisions on trailing commas on the final line breaks rather than the initial line breaks. This can be accomplished by telling perltidy to perform two or more internal iterations, for example with the --converge parameter. In this case any comma addition or deletion operations are postponed until the start of the second iteration, after changes in line breaks have been made. For a discussion see https://github.com/perltidy/perltidy/issues/156.

      +
              # perltidy -wtc=b -dtc --converge
      +        f(
      +            a => 1,
      +            b => 2,
      +        );
      + +

      because changes are based on the line breaks after the first iteration.

      -

      A parameter --delay-trailing-comma-operations, or -dtco, is available to control behavior if desired. Negating this parameter, with -ndtco, tells perltidy to always use the starting state to make decisions regarding comma addition and deletion, even when iterations are requested.

      +

      A parameter --delay-trailing-comma-operations, or -dtco, is available to control this behavior if desired. Negating this parameter, with -ndtco, tells perltidy to always use the starting state to make decisions regarding comma addition and deletion, even when iterations are requested. This should not normally be necessary.

    • -
    • When using these parameters for the first time it is a good idea to practice on some test scripts and verify that the results are as expected.

      +
    • Perltidy does not add a trailing comma to a list which appears to be near a stability limit. So if a comma is unexpectedly not added, this is probably the reason.

      + +

      This issue can be illustrated with the following example. The closing brace is at column 80, the default line length:

      + +
          # perltidy -atc -dtc -wtc=b
      +    $menuitem_paste->signal_connect( 'activate' => sub { create_paste_window() }
      +    );
      + +

      Adding a trailing comma would cause the maximum line length to be exceeded. This in turn would cause a different break point to occur for which the comma is no longer bare. So it would get deleted on the next formatting pass, returning things to the starting state. This is is an unstable situation.

      + +

      The rules used to detect and avoid instability work well but are not precise, so in some cases where perltidy will not add a comma, it may be possible to add a stable trailing comma with editing. For example, if the above example were run with -l=81 -atc -wtc=b, perltidy would still not add a trailing comma, even though it would be stable.

    • -
    • Since the default behavior is not to add or delete commas, these parameters can be useful on a temporary basis for reformatting a script.

      +
    • When using these parameters for the first time it is a good idea to practice on some test scripts and verify that the results are as expected.

    Special Considerations for Lone Trailing Commas

    -

    Adding or deleting the only comma in a list can have some implications which need to be explained and possibly controlled.

    +

    Adding or deleting the only comma in a list can have some implications which need to be explained and possibly controlled. Two additional controls are available for these lone commas:

    + +
      -

      The main issue with deleting a lone comma is that if it is deleted, then it might not be possible add it back automatically since perltidy uses the existance of commas to help locate lists. For example, given

      +
    • --add-lone-trailing-commas, -altc - gives permission to add a comma if it will be the only comma. This is on by default and explained below.

      + +
    • +
    • --delete-lone-trailing-commas, -dltc - gives permission to delete the only comma in a list. This is on by default and explained below.

      + +
    • +
    + +

    One issue with deleting a lone comma is that if it is deleted, then it might not be possible add it back automatically since perltidy uses the existance of commas to help locate containers where commas are appropriate. For example, given

        my ( $self, ) = @_;
    @@ -3229,28 +3280,30 @@

    then we cannot use the trailing comma controls to add this comma back. The parameter --delete-lone-trailing-commas allows such a comma to be deleted, and is on by default, but can be turned off to prevent this. This might be useful if one is experimenting with formatting options and wants to restrict testing to operations which are reversible. Note that this parameter is a fine-tuning control for --delete-trailing-commas which must also be set for it to have any effect.

    -

    Perltidy can add a lone comma to certain lists which themselves contain lists. For example, a comma can be added after the closing hash brace in the following snippet:

    +

    However, if a single item in a list is itself is a list with multiple lines, such as the item in braces here

        $self->make_grammar(
             {
                 iterator => $self->_iterator,
                 parser   => $self,
    -            version  => $self->version,
             }
         );
    -

    However, the parameter --add-lone-trailing-commas must be set to allow such a comma to be added. The reason is that adding such a comma would prevent the --weld-nested-containers flag from operating on this structure. This can be confusing, so this parameter is off by default. Note that this parameter is a fine-tuning control for --add-trailing-commas which must also be set for it to have any effect. To illustrate its use on the above example:

    +

    then perltidy can add and/or delete a lone comma:

    -
        # perltidy -atc -altc -wtc=b
    +
        # perltidy -atc -wtc=b
         $self->make_grammar(
             {
                 iterator => $self->_iterator,
                 parser   => $self,
    -            version  => $self->version,
             },
         );
    -

    This comma can be removed to allow welding with the control described in the next section.

    +

    But it turns out that these cases usually coincide with situations where the --weld-nested-containers, or -wn, would apply, and adding such commas can block welding. For example, the -wn parameter would succeed on the first of the above snippets, but it would fail on the second because of the added trailing comma.

    + +

    The parameter --add-lone-trailing-commas, or -altc allows these commas to be added, provide that --add-trailing-commas is also set. It is on by default. Users of -wn may want to turn it off with --noadd-lone-trailing-commas, -naltc to prevent such commas from being added.

    + +

    If such commas do get added, then can be removed to allow welding with the control described in the next section.

    -dwic, --delete-weld-interfering-commas
    @@ -3263,7 +3316,6 @@ { iterator => $self->_iterator, parser => $self, - version => $self->version, }, );
@@ -3273,7 +3325,6 @@ $self->make_grammar( { iterator => $self->_iterator, parser => $self, - version => $self->version, } );

This feature is off by default. Here are some points to note about the -dwic parameter

@@ -4087,7 +4138,7 @@

As noted above, perltidy will, by default, attempt to create new one-line blocks for certain block types. This flag allows the user to prevent this behavior for the block types listed in the string s. The list s may include any of the words sort, map, grep, eval, or it may be * to indicate all of these.

-

So for example to prevent multi-line eval blocks from becoming one-line blocks, the command would be -olbxl='eval'. In this case, existing one-line eval blocks will remain on one-line if possible, and existing multi-line eval blocks will remain multi-line blocks.

+

So for example to prevent multiline eval blocks from becoming one-line blocks, the command would be -olbxl='eval'. In this case, existing one-line eval blocks will remain on one-line if possible, and existing multiline eval blocks will remain multiline blocks.

-olbn=n, --one-line-block-nesting=n
@@ -5464,7 +5515,7 @@

VERSION

-

This man page documents perltidy version 20240903.01

+

This man page documents perltidy version 20240903.03

BUG REPORTS

diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index e32c50b8..a85c7830 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -135,7 +135,7 @@ BEGIN { # then the Release version must be bumped, and it is probably past time for # a release anyway. - $VERSION = '20240903.02'; + $VERSION = '20240903.03'; } ## end BEGIN sub DESTROY { diff --git a/lib/Perl/Tidy.pod b/lib/Perl/Tidy.pod index 4e0d5a0e..22cdc1b2 100644 --- a/lib/Perl/Tidy.pod +++ b/lib/Perl/Tidy.pod @@ -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 20240903.02 +This man page documents Perl::Tidy version 20240903.03 =head1 LICENSE diff --git a/lib/Perl/Tidy/Debugger.pm b/lib/Perl/Tidy/Debugger.pm index 40d3c5ac..e120d88b 100644 --- a/lib/Perl/Tidy/Debugger.pm +++ b/lib/Perl/Tidy/Debugger.pm @@ -8,7 +8,7 @@ package Perl::Tidy::Debugger; use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; use constant EMPTY_STRING => q{}; use constant SPACE => q{ }; diff --git a/lib/Perl/Tidy/Diagnostics.pm b/lib/Perl/Tidy/Diagnostics.pm index 12cdaed2..7f4595f2 100644 --- a/lib/Perl/Tidy/Diagnostics.pm +++ b/lib/Perl/Tidy/Diagnostics.pm @@ -18,7 +18,7 @@ package Perl::Tidy::Diagnostics; use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 00d38b04..976c3767 100644 --- a/lib/Perl/Tidy/FileWriter.pm +++ b/lib/Perl/Tidy/FileWriter.pm @@ -16,7 +16,7 @@ package Perl::Tidy::FileWriter; use strict; use warnings; -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; use constant DEVEL_MODE => 0; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index df474f25..5373c74d 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -76,7 +76,7 @@ use constant BACKSLASH => 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 = '20240903.02'; +our $VERSION = '20240903.03'; # The Tokenizer will be loaded with the Formatter ##use Perl::Tidy::Tokenizer; # for is_keyword() diff --git a/lib/Perl/Tidy/HtmlWriter.pm b/lib/Perl/Tidy/HtmlWriter.pm index 60adfdc9..5d8fd9b6 100644 --- a/lib/Perl/Tidy/HtmlWriter.pm +++ b/lib/Perl/Tidy/HtmlWriter.pm @@ -7,7 +7,7 @@ package Perl::Tidy::HtmlWriter; use strict; use warnings; -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; use Carp; use English qw( -no_match_vars ); diff --git a/lib/Perl/Tidy/IOScalar.pm b/lib/Perl/Tidy/IOScalar.pm index 30920d9b..358c040e 100644 --- a/lib/Perl/Tidy/IOScalar.pm +++ b/lib/Perl/Tidy/IOScalar.pm @@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar; use strict; use warnings; use Carp; -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; use constant DEVEL_MODE => 0; use constant EMPTY_STRING => q{}; diff --git a/lib/Perl/Tidy/IOScalarArray.pm b/lib/Perl/Tidy/IOScalarArray.pm index 7750942a..210f30ad 100644 --- a/lib/Perl/Tidy/IOScalarArray.pm +++ b/lib/Perl/Tidy/IOScalarArray.pm @@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray; use strict; use warnings; use Carp; -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; use constant DEVEL_MODE => 0; diff --git a/lib/Perl/Tidy/IndentationItem.pm b/lib/Perl/Tidy/IndentationItem.pm index e3500b09..b5f832ed 100644 --- a/lib/Perl/Tidy/IndentationItem.pm +++ b/lib/Perl/Tidy/IndentationItem.pm @@ -9,7 +9,7 @@ package Perl::Tidy::IndentationItem; use strict; use warnings; -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; BEGIN { diff --git a/lib/Perl/Tidy/Logger.pm b/lib/Perl/Tidy/Logger.pm index b04fe379..01844ed3 100644 --- a/lib/Perl/Tidy/Logger.pm +++ b/lib/Perl/Tidy/Logger.pm @@ -8,7 +8,7 @@ package Perl::Tidy::Logger; use strict; use warnings; -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; use Carp; use English qw( -no_match_vars ); diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 13f6c20e..fca14ba6 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -33,7 +33,7 @@ use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; use Carp; diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 1d71d1b0..e58aa346 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -5,7 +5,7 @@ use Carp; { #<<< A non-indenting brace to contain all lexical variables -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; use English qw( -no_match_vars ); use Scalar::Util 'refaddr'; # perl 5.8.1 and later use Perl::Tidy::VerticalAligner::Alignment; @@ -2904,7 +2904,10 @@ EOM #---------------------------------------------------- # Create a hash of alignment token info for each line #---------------------------------------------------- - ( my $rline_hashes, my $requals_info, $saw_side_comment, $max_lev_diff ) + ( + my $rline_hashes, my $requals_info, + $saw_side_comment, $max_lev_diff + ) = make_alignment_info( $group_level, $rnew_lines, $saw_side_comment ); #------------------------------------------------------------ diff --git a/lib/Perl/Tidy/VerticalAligner/Alignment.pm b/lib/Perl/Tidy/VerticalAligner/Alignment.pm index 5b394abc..1e999768 100644 --- a/lib/Perl/Tidy/VerticalAligner/Alignment.pm +++ b/lib/Perl/Tidy/VerticalAligner/Alignment.pm @@ -9,7 +9,7 @@ package Perl::Tidy::VerticalAligner::Alignment; use strict; use warnings; -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; sub new { my ( $class, $rarg ) = @_; diff --git a/lib/Perl/Tidy/VerticalAligner/Line.pm b/lib/Perl/Tidy/VerticalAligner/Line.pm index edbc9cfd..1b1250ca 100644 --- a/lib/Perl/Tidy/VerticalAligner/Line.pm +++ b/lib/Perl/Tidy/VerticalAligner/Line.pm @@ -10,7 +10,7 @@ package Perl::Tidy::VerticalAligner::Line; use strict; use warnings; -our $VERSION = '20240903.02'; +our $VERSION = '20240903.03'; use English qw( -no_match_vars ); sub AUTOLOAD { -- 2.39.5