line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Tag;
|
2
|
36
|
|
|
36
|
|
12622
|
use strict; use utf8; use warnings FATAL => 'all';
|
|
36
|
|
|
36
|
|
97
|
|
|
36
|
|
|
36
|
|
749
|
|
|
36
|
|
|
|
|
103
|
|
|
36
|
|
|
|
|
37
|
|
|
36
|
|
|
|
|
119
|
|
|
36
|
|
|
|
|
586
|
|
|
36
|
|
|
|
|
39
|
|
|
36
|
|
|
|
|
937
|
|
3
|
36
|
|
|
36
|
|
108
|
use parent 'DTL::Fast::Parser';
|
|
36
|
|
|
|
|
33
|
|
|
36
|
|
|
|
|
153
|
|
4
|
|
|
|
|
|
|
|
5
|
36
|
|
|
36
|
|
1834
|
use DTL::Fast;
|
|
36
|
|
|
|
|
45
|
|
|
36
|
|
|
|
|
1251
|
|
6
|
36
|
|
|
36
|
|
138
|
use DTL::Fast::Template;
|
|
36
|
|
|
|
|
41
|
|
|
36
|
|
|
|
|
13140
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new
|
9
|
|
|
|
|
|
|
{
|
10
|
843
|
|
|
843
|
0
|
1804
|
my( $proto, $parameter, %kwargs ) = @_;
|
11
|
843
|
|
50
|
|
|
1352
|
$parameter //= '';
|
12
|
|
|
|
|
|
|
|
13
|
843
|
|
|
|
|
2865
|
$parameter =~ s/^\s+|\s+$//gs;
|
14
|
|
|
|
|
|
|
|
15
|
843
|
|
|
|
|
1067
|
$kwargs{'parameter'} = $parameter;
|
16
|
|
|
|
|
|
|
|
17
|
843
|
|
|
|
|
2452
|
return $proto->SUPER::new(%kwargs);
|
18
|
|
|
|
|
|
|
}
|
19
|
|
|
|
|
|
|
|
20
|
22
|
|
|
22
|
0
|
28
|
sub parse_parameters{return shift;}
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub parse_chunks
|
23
|
|
|
|
|
|
|
{
|
24
|
843
|
|
|
843
|
0
|
731
|
my( $self ) = @_;
|
25
|
843
|
|
|
|
|
1967
|
$self->parse_parameters();
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$DTL::Fast::Template::CURRENT_TEMPLATE_LINE += $self->{'_open_tag_lines'}
|
28
|
828
|
100
|
|
|
|
1541
|
if $self->{'_open_tag_lines'};
|
29
|
|
|
|
|
|
|
|
30
|
828
|
|
|
|
|
1787
|
return $self->SUPER::parse_chunks();
|
31
|
|
|
|
|
|
|
}
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub get_close_tag
|
34
|
|
|
|
|
|
|
{
|
35
|
0
|
|
|
0
|
0
|
0
|
my( $self ) = @_;
|
36
|
0
|
|
|
|
|
0
|
die sprintf(
|
37
|
|
|
|
|
|
|
"ABSTRACT method get_close_tag, must be overriden in %s"
|
38
|
|
|
|
|
|
|
, ref $self
|
39
|
|
|
|
|
|
|
);
|
40
|
|
|
|
|
|
|
}
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# Close tag processor
|
43
|
|
|
|
|
|
|
sub parse_tag_chunk
|
44
|
|
|
|
|
|
|
{
|
45
|
946
|
|
|
946
|
0
|
1033
|
my( $self, $tag_name, $tag_param, $chunk_lines ) = @_;
|
46
|
|
|
|
|
|
|
|
47
|
946
|
|
|
|
|
831
|
my $result = undef;
|
48
|
|
|
|
|
|
|
|
49
|
946
|
100
|
|
|
|
1638
|
if( $tag_name eq $self->get_close_tag )
|
50
|
|
|
|
|
|
|
{
|
51
|
640
|
|
|
|
|
723
|
$self->{'raw_chunks'} = []; # this stops parsing
|
52
|
640
|
|
|
|
|
683
|
$DTL::Fast::Template::CURRENT_TEMPLATE_LINE += $chunk_lines;
|
53
|
|
|
|
|
|
|
}
|
54
|
|
|
|
|
|
|
else
|
55
|
|
|
|
|
|
|
{
|
56
|
306
|
|
|
|
|
657
|
$result = $self->SUPER::parse_tag_chunk($tag_name, $tag_param, $chunk_lines);
|
57
|
|
|
|
|
|
|
}
|
58
|
|
|
|
|
|
|
|
59
|
922
|
|
|
|
|
1402
|
return $result;
|
60
|
|
|
|
|
|
|
}
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# returns restored opening tag
|
63
|
|
|
|
|
|
|
sub open_tag_syntax
|
64
|
|
|
|
|
|
|
{
|
65
|
2
|
|
|
2
|
0
|
3
|
my ($self) = @_;
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
return join( ' ',
|
68
|
|
|
|
|
|
|
grep(
|
69
|
|
|
|
|
|
|
$_
|
70
|
|
|
|
|
|
|
, (
|
71
|
|
|
|
|
|
|
'{%'
|
72
|
|
|
|
|
|
|
, $DTL::Fast::KNOWN_SLUGS{ref $self}
|
73
|
2
|
|
|
|
|
42
|
, $self->{'parameter'}
|
74
|
|
|
|
|
|
|
, '%}'
|
75
|
|
|
|
|
|
|
)
|
76
|
|
|
|
|
|
|
)
|
77
|
|
|
|
|
|
|
);
|
78
|
|
|
|
|
|
|
}
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# returns restored opening tag
|
81
|
|
|
|
|
|
|
sub open_tag_syntax_with_line_number
|
82
|
|
|
|
|
|
|
{
|
83
|
2
|
|
|
2
|
0
|
2
|
my ($self) = @_;
|
84
|
2
|
|
50
|
|
|
11
|
return $self->open_tag_syntax().' at line '.($self->{'_template_line'} // 'unknown');
|
85
|
|
|
|
|
|
|
}
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub get_block_parse_error
|
88
|
|
|
|
|
|
|
{
|
89
|
1
|
|
|
1
|
0
|
2
|
my ($self, $message) = @_;
|
90
|
|
|
|
|
|
|
return $self->get_parse_error(
|
91
|
|
|
|
|
|
|
$message,
|
92
|
|
|
|
|
|
|
'Block' => sprintf(
|
93
|
|
|
|
|
|
|
'%s at line %s'
|
94
|
|
|
|
|
|
|
, ref $self
|
95
|
1
|
|
50
|
|
|
14
|
, $self->{'_template_line'} // 'unknown'
|
96
|
|
|
|
|
|
|
)
|
97
|
|
|
|
|
|
|
);
|
98
|
|
|
|
|
|
|
}
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
1;
|