]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix to allow both -dbc and -tbc in same run
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 30 Apr 2020 23:44:03 +0000 (16:44 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 30 Apr 2020 23:44:03 +0000 (16:44 -0700)
lib/Perl/Tidy/Formatter.pm

index 37ef42a7b80a75f1649f03354c88f4b2ddf0853c..c770898bee361d861b7bd6ecfe4d1fba5ef7c97d 100644 (file)
@@ -1496,12 +1496,6 @@ sub break_lines {
                 next;
             }
 
-            # Handle block comment to be deleted
-            elsif ( $CODE_type eq 'DEL' ) {
-                $self->flush();
-                next;
-            }
-
             # Handle all other lines of code
             $self->process_line_of_CODE($line_of_tokens);
         }
@@ -2645,7 +2639,6 @@ sub respace_tokens {
             # 'SBC'=Static Block Comment - a block comment which does not get
             #      indented
             # 'SBCX'=Static Block Comment Without Leading Space
-            # 'DEL'=Delete this line
             # 'VER'=VERSION statement
             # '' or (undefined) - no restructions
 
@@ -3125,7 +3118,6 @@ sub respace_tokens {
         # 'SBC'=Static Block Comment - a block comment which does not get
         #      indented
         # 'SBCX'=Static Block Comment Without Leading Space
-        # 'DEL'=Delete this line
         # 'VER'=VERSION statement
         # '' or (undefined) - no restructions
 
@@ -3262,8 +3254,6 @@ sub respace_tokens {
         # Handle a block (full-line) comment..
         if ($is_block_comment) {
 
-            if ( $rOpts->{'delete-block-comments'} ) { return 'DEL' }
-
             # TRIM COMMENTS -- This could be turned off as a option
             $rLL->[$Kfirst]->[_TOKEN_] =~ s/\s*$//;    # trim right end
 
@@ -7219,6 +7209,10 @@ sub copy_token_as_type {
             if ( $rOpts->{'tee-block-comments'} ) {
                 $sink_object->write_tee_line($input_line);
             }
+            if ( $rOpts->{'delete-block-comments'} ) {
+                $self->flush();
+                return;
+            }
 
             destroy_one_line_block();
             $self->process_batch_of_CODE();