line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Tag::Verbatim; |
2
|
3
|
|
|
3
|
|
2040
|
use strict; use utf8; use warnings FATAL => 'all'; |
|
3
|
|
|
3
|
|
5
|
|
|
3
|
|
|
3
|
|
79
|
|
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
17
|
|
|
3
|
|
|
|
|
70
|
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
108
|
|
3
|
3
|
|
|
3
|
|
14
|
use parent 'DTL::Fast::Tag'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
18
|
|
4
|
|
|
|
|
|
|
$DTL::Fast::TAG_HANDLERS{'verbatim'} = __PACKAGE__; |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
211
|
use DTL::Fast::Text; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
864
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#@Override |
9
|
0
|
|
|
0
|
0
|
0
|
sub get_close_tag{return 'endverbatim';} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#@Override |
12
|
|
|
|
|
|
|
sub parse_parameters |
13
|
|
|
|
|
|
|
{ |
14
|
22
|
|
|
22
|
0
|
34
|
my $self = shift; |
15
|
22
|
|
|
|
|
360
|
$self->{'contents'} = DTL::Fast::Text->new(); |
16
|
22
|
100
|
|
|
|
87
|
$self->{'last_tag'} = $self->{'parameter'} ? |
17
|
|
|
|
|
|
|
qr/\Qendverbatim\E\s+\Q$self->{'parameter'}\E/ |
18
|
|
|
|
|
|
|
: 'endverbatim'; |
19
|
22
|
|
|
|
|
46
|
return $self; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#@Override |
23
|
|
|
|
|
|
|
sub parse_next_chunk |
24
|
|
|
|
|
|
|
{ |
25
|
130
|
|
|
130
|
0
|
190
|
my $self = shift; |
26
|
130
|
|
|
|
|
147
|
my $chunk = shift @{$self->{'raw_chunks'}}; |
|
130
|
|
|
|
|
236
|
|
27
|
130
|
|
100
|
|
|
679
|
my $chunk_lines = scalar (my @tmp = $chunk =~ /(\n)/g ) || 0; |
28
|
|
|
|
|
|
|
|
29
|
130
|
100
|
|
|
|
611
|
if( $chunk =~ /^\{\%\s*$self->{'last_tag'}\s*\%\}$/six ) |
30
|
|
|
|
|
|
|
{ |
31
|
22
|
|
|
|
|
47
|
$self->{'raw_chunks'} = []; # this stops parsing |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
else |
34
|
|
|
|
|
|
|
{ |
35
|
108
|
|
|
|
|
312
|
$self->{'contents'}->append($chunk); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
130
|
|
|
|
|
160
|
$DTL::Fast::Template::CURRENT_TEMPLATE_LINE += $chunk_lines; |
39
|
|
|
|
|
|
|
|
40
|
130
|
|
|
|
|
491
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
#@Override |
44
|
|
|
|
|
|
|
sub render |
45
|
|
|
|
|
|
|
{ |
46
|
11
|
|
|
11
|
0
|
40
|
return shift->{'contents'}->render(shift); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |