]> git.donarmstrong.com Git - perltidy.git/commitdiff
clean up debug flags
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 19 Nov 2020 01:15:38 +0000 (17:15 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 19 Nov 2020 01:15:38 +0000 (17:15 -0800)
dev-bin/build.pl
lib/Perl/Tidy/VerticalAligner.pm

index 8429996199ce22ec9e8424f031b629436ee5242c..8ecab49272b0e371052e2fb77966dfc6de97d592 100755 (executable)
@@ -628,9 +628,10 @@ sub update_VERSION {
     my $is_pod_file = !$is_md_file && $source_file !~ /\.pm/;
     while ( my $line = <$fh> ) {
 
-        # Look for and turn off any DEVEL_MODE or DEBUG_XXX or VERIFY_XXX constants
+       # Look for and turn off any DEVEL_MODE, DEBUG_XXX, VERIFY_XXX,
+       # and EXPLAIN_XXX constants
         if ( $line =~
-            /^(\s*use\s+constant\s+(?:DEBUG|DEVEL|VERIFY)_[A-Z]+\s*)=>\s*(-?\d*);(.*)$/
+/^(\s*use\s+constant\s+(?:DEBUG|DEVEL|EXPLAIN|VERIFY)_[A-Z]+\s*)=>\s*(-?\d*);(.*)$/
           )
         {
             if ( $2 != 0 ) {
index a5b4dbf182678107004959dbea50b53bec5b242c..5ffae066117779b14b032c246fa730aa13860204 100644 (file)
@@ -126,14 +126,14 @@ BEGIN {
     # produce a lot of output It should be 0 except when debugging small
     # scripts.
 
-    use constant VALIGN_DEBUG_FLAG_TABS => 0;
+    use constant DEBUG_TABS => 0;
 
     my $debug_warning = sub {
         print STDOUT "VALIGN_DEBUGGING with key $_[0]\n";
         return;
     };
 
-    VALIGN_DEBUG_FLAG_TABS && $debug_warning->('TABS');
+    DEBUG_TABS && $debug_warning->('TABS');
 
 }
 
@@ -335,6 +335,8 @@ sub push_group_line {
     return;
 }
 
+use constant DEBUG_VALIGN => 0;
+
 sub valign_input {
 
     # Place one line in the current vertical group.
@@ -456,7 +458,7 @@ sub valign_input {
 
     my $group_level = $self->[_group_level_];
 
-    0 && do {
+    DEBUG_VALIGN && do {
         my $nlines = $self->group_line_count();
         print STDOUT
 "Entering valign_input: lines=$nlines new #fields= $jmax, leading_count=$leading_space_count force=$is_forced_break, level_jump=$level_jump, level=$level, group_level=$group_level, level_jump=$level_jump\n";
@@ -722,7 +724,7 @@ EOM
     # --------------------------------------------------------------------
     # Some old debugging stuff
     # --------------------------------------------------------------------
-    0 && do {
+    DEBUG_VALIGN && do {
         print STDOUT "exiting valign_input fields:";
         dump_array( @{$rfields} );
         print STDOUT "exiting valign_input tokens:";
@@ -4542,7 +4544,7 @@ sub valign_output_step_D {
 
                 # shouldn't happen - program error counting whitespace
                 # - skip entabbing
-                VALIGN_DEBUG_FLAG_TABS
+                DEBUG_TABS
                   && $self->warning(
 "Error entabbing in valign_output_step_D: expected count=$leading_space_count\n"
                   );
@@ -4560,7 +4562,7 @@ sub valign_output_step_D {
 
                 # But it could be an outdented comment
                 if ( $line !~ /^\s*#/ ) {
-                    VALIGN_DEBUG_FLAG_TABS
+                    DEBUG_TABS
                       && $self->warning(
 "Error entabbing in valign_output_step_D: for level=$level count=$leading_space_count\n"
                       );
@@ -4577,7 +4579,7 @@ sub valign_output_step_D {
 
                 # shouldn't happen - program error counting whitespace
                 # we'll skip entabbing
-                VALIGN_DEBUG_FLAG_TABS
+                DEBUG_TABS
                   && $self->warning(
 "Error entabbing in valign_output_step_D: expected count=$leading_space_count\n"
                   );
@@ -4646,7 +4648,7 @@ sub valign_output_step_D {
 
             # shouldn't happen:
             if ( $space_count < 0 ) {
-                VALIGN_DEBUG_FLAG_TABS
+                DEBUG_TABS
                   && $self->warning(
 "Error in get_leading_string: for level=$group_level count=$leading_whitespace_count\n"
                   );