]> git.donarmstrong.com Git - perltidy.git/commitdiff
--dump-block-summary sub arg count now includes any $self
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 23 Mar 2024 19:54:37 +0000 (12:54 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 23 Mar 2024 19:54:37 +0000 (12:54 -0700)
CHANGES.md
bin/perltidy
lib/Perl/Tidy/Formatter.pm

index 4570348a52378265a6107043992eb81350550bab..4a6b44f54cd34344d3ddeb8ee4c84741228a7b5f 100644 (file)
@@ -2,6 +2,12 @@
 
 ## 2024 02 02.02
 
+    - In the option --dump-block-summary, the number of sub arguments indicated
+      for each sub now includes any leading object variable passed with
+      an arrow-operator call.  Previously the count would have been decreased
+      by one in this case. This change is needed for compatibility with future
+      updates.
+
     - The operator ``**=`` now has spaces on both sides by default. Previously,
       there was no space on the left.  This change makes its spacing the same
       as all other assignment operators. The previous behavior can be obtained
index 2dc4468b6c4108581af5277371c238f0aec23780..0dec9ad0abe55a82a8dcb856b16a64538d4d4dbe 100755 (executable)
@@ -5738,8 +5738,8 @@ determined by computing and comparing the block ending line numbers.
 For subroutines, the number of call arguments (args) is listed in parentheses
 in the C<type> column. For example, C<sub(9)> indicates a sub with 9 args.
 Subroutines whose arg count cannot easily be determined are indicated
-as C<sub(*)>.  The count does not include a leading variable named
-B<$self> or B<$class>.
+as C<sub(*)>.  The count includes any leading object passed in a method
+call (such as B<$self>).
 
 By default the table lists subroutines with more than 20 C<code_lines>, but
 this can be changed with the following two parameters:
index 7353c06e927f850e76e1c027646a50c78e8ef030..29c4d4ea670a14a0289e11366fa0b6bd819fc1d8 100644 (file)
@@ -6994,13 +6994,6 @@ EOM
             my $rarg = { seqno => $seqno };
             $self->count_sub_args($rarg);
             my $count     = $rarg->{shift_count};
-            my $self_name = $rarg->{self_name};
-            if (   $count
-                && $self_name
-                && ( $self_name eq '$self' || $self_name eq '$class' ) )
-            {
-                $count -= 1;
-            }
             if ( !defined($count) ) { $count = '*' }
 
             $type .= '(' . $count . ')';
@@ -7021,13 +7014,6 @@ EOM
             my $rarg = { seqno => $seqno };
             $self->count_sub_args($rarg);
             my $count     = $rarg->{shift_count};
-            my $self_name = $rarg->{self_name};
-            if (   $count
-                && $self_name
-                && ( $self_name eq '$self' || $self_name eq '$class' ) )
-            {
-                $count -= 1;
-            }
             if ( !defined($count) ) { $count = '*' }
 
             $type .= '(' . $count . ')';