From b8fa10ce9b07f36597bf6531c9978f05cd60f326 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 2 Jan 2024 14:46:23 -0800 Subject: [PATCH] skip certain operations during iterations --- lib/Perl/Tidy/Formatter.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 88e4d6f4..d47ac851 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -6424,7 +6424,7 @@ EOM Exit(0); } - # Act on -warn-variable-types if requesed and if the logger is available + # Act on -warn-variable-types if requested and the logger is available # (the logger is deactivated during iterations) $self->warn_variable_types() if ( $rOpts->{'warn-variable-types'} @@ -6435,7 +6435,11 @@ EOM Exit(0); } - $self->scan_call_parens(); + # Act on -want-call-parens and --nowant-call-parens requested and the + # logger is available (the logger is deactivated during iterations) + $self->scan_call_parens() + if ( %call_paren_style + && $self->[_logger_object_] ); $self->examine_vertical_tightness_flags(); @@ -9840,12 +9844,10 @@ sub initialize_call_paren_style { # words must be simple identifiers, or '&' if ( $word !~ /^(?:\&|\w+)$/ || $word =~ /^\d/ ) { - Die( - "Unexpected word in --$opt_name: '$word'\n"); + Die("Unexpected word in --$opt_name: '$word'\n"); } if ( $iter && defined( $call_paren_style{$word} ) ) { - Warn( - "'$word' occurs in both -nwcp and -wcp, using -wcp\n"); + Warn("'$word' occurs in both -nwcp and -wcp, using -wcp\n"); } } @call_paren_style{@q} = ($iter) x scalar(@q); -- 2.39.5