line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Tag::Templatetag; |
2
|
2
|
|
|
2
|
|
802
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
47
|
|
3
|
2
|
|
|
2
|
|
8
|
use utf8; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
11
|
|
4
|
2
|
|
|
2
|
|
40
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
5
|
2
|
|
|
2
|
|
9
|
use parent 'DTL::Fast::Tag::Simple'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
10
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$DTL::Fast::TAG_HANDLERS{templatetag} = __PACKAGE__; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our %TAG_MAP = ( |
10
|
|
|
|
|
|
|
openblock => '{%', |
11
|
|
|
|
|
|
|
closeblock => '%}', |
12
|
|
|
|
|
|
|
openvariable => '{{', |
13
|
|
|
|
|
|
|
closevariable => '}}', |
14
|
|
|
|
|
|
|
openbrace => '{', |
15
|
|
|
|
|
|
|
closebrace => '}', |
16
|
|
|
|
|
|
|
opencomment => '{#', |
17
|
|
|
|
|
|
|
closecomment => '#}', |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#@Override |
21
|
|
|
|
|
|
|
sub parse_parameters |
22
|
|
|
|
|
|
|
{ |
23
|
16
|
|
|
16
|
0
|
24
|
my $self = shift; |
24
|
|
|
|
|
|
|
|
25
|
16
|
50
|
|
|
|
49
|
if (not ($self->{value} = $TAG_MAP{$self->{parameter}})) |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
|
|
0
|
die $self->get_parse_error("unknown template tag $self->{parameter}"); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
16
|
|
|
|
|
31
|
return $self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#@Override |
34
|
|
|
|
|
|
|
sub render |
35
|
|
|
|
|
|
|
{ |
36
|
16
|
|
|
16
|
0
|
43
|
return shift->{value}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |