File Coverage

blib/lib/DTL/Fast/Tag/Comment.pm
Criterion Covered Total %
statement 24 25 96.0
branch 2 2 100.0
condition 2 2 100.0
subroutine 7 8 87.5
pod 0 3 0.0
total 35 40 87.5


line stmt bran cond sub pod time code
1             package DTL::Fast::Tag::Comment;
2 3     3   1965 use strict; use utf8; use warnings FATAL => 'all';
  3     3   6  
  3     3   73  
  3         15  
  3         4  
  3         16  
  3         71  
  3         7  
  3         102  
3 3     3   16 use parent 'DTL::Fast::Tag';
  3         5  
  3         16  
4              
5             $DTL::Fast::TAG_HANDLERS{'comment'} = __PACKAGE__;
6              
7 3     3   223 use DTL::Fast::Text;
  3         7  
  3         635  
8              
9             #@Override
10 0     0 0 0 sub get_close_tag{return 'endcomment';}
11              
12             #@Override
13             sub parse_next_chunk
14             {
15 80     80 0 103 my $self = shift;
16 80         97 my $chunk = shift @{$self->{'raw_chunks'}};
  80         150  
17 80   100     433 my $chunk_lines = scalar (my @tmp = $chunk =~ /(\n)/g ) || 0;
18            
19 80 100       252 if( $chunk =~ /^\{\%\s*endcomment\s*\%\}$/six )
20             {
21 16         36 $self->{'raw_chunks'} = []; # this stops parsing
22             }
23              
24 80         104 $DTL::Fast::Template::CURRENT_TEMPLATE_LINE += $chunk_lines;
25            
26 80         288 return;
27             }
28              
29             #@Override
30             sub render
31             {
32 10     10 0 36 return '';
33             }
34              
35             1;