remove hardwired arg count checks; -wmat automates this
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 7 Apr 2024 13:51:26 +0000 (06:51 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 7 Apr 2024 13:51:26 +0000 (06:51 -0700)
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/Tokenizer.pm

index b1a6920bf617fac9025618f3b2e713c2b2378f0b..8d9a1e9bb68f37e237e582663c774d7e9c6c22a0 100644 (file)
@@ -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.
index bb07297ba0f54c50e00c61571c6de41772199057..88f4747b96d086c6e67ac2db0a9269de8c494436 100644 (file)
@@ -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;