line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Tag; |
2
|
36
|
|
|
36
|
|
21211
|
use strict; use utf8; use warnings FATAL => 'all'; |
|
36
|
|
|
36
|
|
66
|
|
|
36
|
|
|
36
|
|
872
|
|
|
36
|
|
|
|
|
172
|
|
|
36
|
|
|
|
|
65
|
|
|
36
|
|
|
|
|
173
|
|
|
36
|
|
|
|
|
887
|
|
|
36
|
|
|
|
|
72
|
|
|
36
|
|
|
|
|
1205
|
|
3
|
36
|
|
|
36
|
|
225
|
use parent 'DTL::Fast::Parser'; |
|
36
|
|
|
|
|
72
|
|
|
36
|
|
|
|
|
198
|
|
4
|
|
|
|
|
|
|
|
5
|
36
|
|
|
36
|
|
2347
|
use DTL::Fast; |
|
36
|
|
|
|
|
69
|
|
|
36
|
|
|
|
|
1485
|
|
6
|
36
|
|
|
36
|
|
180
|
use DTL::Fast::Template; |
|
36
|
|
|
|
|
73
|
|
|
36
|
|
|
|
|
19233
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new |
9
|
|
|
|
|
|
|
{ |
10
|
843
|
|
|
843
|
0
|
2695
|
my( $proto, $parameter, %kwargs ) = @_; |
11
|
843
|
|
50
|
|
|
1946
|
$parameter //= ''; |
12
|
|
|
|
|
|
|
|
13
|
843
|
|
|
|
|
4067
|
$parameter =~ s/^\s+|\s+$//gs; |
14
|
|
|
|
|
|
|
|
15
|
843
|
|
|
|
|
1603
|
$kwargs{'parameter'} = $parameter; |
16
|
|
|
|
|
|
|
|
17
|
843
|
|
|
|
|
3430
|
return $proto->SUPER::new(%kwargs); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
22
|
|
|
22
|
0
|
35
|
sub parse_parameters{return shift;} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub parse_chunks |
23
|
|
|
|
|
|
|
{ |
24
|
843
|
|
|
843
|
0
|
1198
|
my( $self ) = @_; |
25
|
843
|
|
|
|
|
2417
|
$self->parse_parameters(); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$DTL::Fast::Template::CURRENT_TEMPLATE_LINE += $self->{'_open_tag_lines'} |
28
|
828
|
100
|
|
|
|
2080
|
if $self->{'_open_tag_lines'}; |
29
|
|
|
|
|
|
|
|
30
|
828
|
|
|
|
|
2504
|
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
|
1664
|
my( $self, $tag_name, $tag_param, $chunk_lines ) = @_; |
46
|
|
|
|
|
|
|
|
47
|
946
|
|
|
|
|
1142
|
my $result = undef; |
48
|
|
|
|
|
|
|
|
49
|
946
|
100
|
|
|
|
2545
|
if( $tag_name eq $self->get_close_tag ) |
50
|
|
|
|
|
|
|
{ |
51
|
640
|
|
|
|
|
1167
|
$self->{'raw_chunks'} = []; # this stops parsing |
52
|
640
|
|
|
|
|
949
|
$DTL::Fast::Template::CURRENT_TEMPLATE_LINE += $chunk_lines; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
else |
55
|
|
|
|
|
|
|
{ |
56
|
306
|
|
|
|
|
955
|
$result = $self->SUPER::parse_tag_chunk($tag_name, $tag_param, $chunk_lines); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
922
|
|
|
|
|
2364
|
return $result; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# returns restored opening tag |
63
|
|
|
|
|
|
|
sub open_tag_syntax |
64
|
|
|
|
|
|
|
{ |
65
|
2
|
|
|
2
|
0
|
4
|
my ($self) = @_; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
return join( ' ', |
68
|
|
|
|
|
|
|
grep( |
69
|
|
|
|
|
|
|
$_ |
70
|
|
|
|
|
|
|
, ( |
71
|
|
|
|
|
|
|
'{%' |
72
|
|
|
|
|
|
|
, $DTL::Fast::KNOWN_SLUGS{ref $self} |
73
|
2
|
|
|
|
|
41
|
, $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
|
4
|
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
|
3
|
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; |