From 23b2b7c60f3d12b36e4c6c0c2eccc2cce46e9bce Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 7 Apr 2024 06:51:26 -0700 Subject: [PATCH] remove hardwired arg count checks; -wmat automates this --- lib/Perl/Tidy/Formatter.pm | 16 ---------------- lib/Perl/Tidy/Tokenizer.pm | 24 ------------------------ 2 files changed, 40 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index b1a6920b..8d9a1e9b 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -25880,10 +25880,6 @@ sub break_lines_inner_loop { ) = @_; - if ( DEVEL_MODE && ( my $count = @_ ) != ( my $expected_count = 8 ) ) { - Fault("arg count $count expected to be $expected_count\n"); - } - # Given: # $i_begin = first index of range # $i_last_break = index of previous break @@ -33965,10 +33961,6 @@ sub make_paren_name { ) = @_; - if ( DEVEL_MODE && ( my $count = @_ ) != ( my $expected_count = 9 ) ) { - Fault("arg count $count expected to be $expected_count\n"); - } - #-------------------------------------------------------------- # This routine makes any necessary adjustments to get the final # indentation of a line in the Formatter. @@ -34483,10 +34475,6 @@ sub make_paren_name { ) = @_; - if ( DEVEL_MODE && ( my $count = @_ ) != ( my $expected_count = 10 ) ) { - Fault("arg count $count expected to be $expected_count\n"); - } - my $adjust_indentation = 0; my $default_adjust_indentation = $adjust_indentation; my $terminal_type = $types_to_go[$i_terminal]; @@ -35017,10 +35005,6 @@ sub set_vertical_tightness_flags { ) = @_; - if ( DEVEL_MODE && ( my $count = @_ ) != ( my $expected_count = 9 ) ) { - Fault("arg count $count expected to be $expected_count\n"); - } - # Define vertical tightness controls for the nth line of a batch. # Note: do not call this sub for a block comment or if # $rOpts_freeze_whitespace is set. diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index bb07297b..88f4747b 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -7745,10 +7745,6 @@ sub scan_bare_identifier_do { ) = @_; - if ( DEVEL_MODE && ( my $count = @_ ) != ( my $expected_count = 8 ) ) { - $self->Fault("arg count $count expected to be $expected_count\n"); - } - my $i_begin = $i; my $package = undef; @@ -7985,10 +7981,6 @@ sub scan_id_do { ) = @_; - if ( DEVEL_MODE && ( my $count = @_ ) != ( my $expected_count = 8 ) ) { - $self->Fault("arg count $count expected to be $expected_count\n"); - } - use constant DEBUG_NSCAN => 0; my $type = EMPTY_STRING; my $i_beg; @@ -8873,10 +8865,6 @@ sub do_scan_package { ) = @_; - if ( DEVEL_MODE && ( my $count = @_ ) != ( my $expected_count = 8 ) ) { - $self->Fault("arg count $count expected to be $expected_count\n"); - } - # return flag telling caller to split the pretoken my $split_pretoken_flag; @@ -10122,10 +10110,6 @@ sub find_here_doc { ) = @_; - if ( DEVEL_MODE && ( my $count = @_ ) != ( my $expected_count = 7 ) ) { - $self->Fault("arg count $count expected to be $expected_count\n"); - } - my $ibeg = $i; my $found_target = 0; my $here_doc_target = EMPTY_STRING; @@ -10269,10 +10253,6 @@ sub do_quote { ) = @_; - if ( DEVEL_MODE && ( my $count = @_ ) != ( my $expected_count = 12 ) ) { - $self->Fault("arg count $count expected to be $expected_count\n"); - } - my $quoted_string; if ( $in_quote == 2 ) { # two quotes/quoted_string_1s to follow my $ibeg = $i; @@ -10389,10 +10369,6 @@ sub follow_quoted_string { ) = @_; - if ( DEVEL_MODE && ( my $count = @_ ) != ( my $expected_count = 9 ) ) { - $self->Fault("arg count $count expected to be $expected_count\n"); - } - my ( $tok, $end_tok ); my $i = $i_beg - 1; my $quoted_string = EMPTY_STRING; -- 2.39.5