From: Steve Hancock Date: Sat, 23 Mar 2024 19:54:37 +0000 (-0700) Subject: --dump-block-summary sub arg count now includes any $self X-Git-Tag: 20240202.03~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=47a1b22f5f3e0b318de2a86cc14b6818c6359bc4;p=perltidy.git --dump-block-summary sub arg count now includes any $self --- diff --git a/CHANGES.md b/CHANGES.md index 4570348a..4a6b44f5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/bin/perltidy b/bin/perltidy index 2dc4468b..0dec9ad0 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -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 column. For example, C indicates a sub with 9 args. Subroutines whose arg count cannot easily be determined are indicated -as C. The count does not include a leading variable named -B<$self> or B<$class>. +as C. 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, but this can be changed with the following two parameters: diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 7353c06e..29c4d4ea 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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 . ')';