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