line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Text; |
2
|
98
|
|
|
98
|
|
654
|
use strict; |
|
98
|
|
|
|
|
197
|
|
|
98
|
|
|
|
|
2494
|
|
3
|
98
|
|
|
98
|
|
459
|
use utf8; |
|
98
|
|
|
|
|
187
|
|
|
98
|
|
|
|
|
482
|
|
4
|
98
|
|
|
98
|
|
2170
|
use warnings FATAL => 'all'; |
|
98
|
|
|
|
|
183
|
|
|
98
|
|
|
|
|
3288
|
|
5
|
|
|
|
|
|
|
|
6
|
98
|
|
|
98
|
|
471
|
use DTL::Fast::Template; |
|
98
|
|
|
|
|
195
|
|
|
98
|
|
|
|
|
1974
|
|
7
|
98
|
|
|
98
|
|
460
|
use Scalar::Util qw/weaken/; |
|
98
|
|
|
|
|
195
|
|
|
98
|
|
|
|
|
18483
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
2392
|
|
|
2392
|
0
|
4426
|
my ($proto, $text ) = @_; |
12
|
2392
|
|
100
|
|
|
5149
|
$text //= ''; |
13
|
|
|
|
|
|
|
|
14
|
2392
|
|
|
|
|
7418
|
my $self = bless { |
15
|
|
|
|
|
|
|
texts => [ $text ] |
16
|
|
|
|
|
|
|
, _template => $DTL::Fast::Template::CURRENT_TEMPLATE |
17
|
|
|
|
|
|
|
, _template_line => $DTL::Fast::Template::CURRENT_TEMPLATE_LINE |
18
|
|
|
|
|
|
|
}, $proto; |
19
|
|
|
|
|
|
|
|
20
|
2392
|
|
|
|
|
6435
|
weaken $self->{_template}; |
21
|
|
|
|
|
|
|
|
22
|
2392
|
|
|
|
|
5114
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub append |
26
|
|
|
|
|
|
|
{ |
27
|
108
|
|
|
108
|
0
|
154
|
my $self = shift; |
28
|
108
|
|
100
|
|
|
268
|
$self->{need_join} ||= 1; |
29
|
108
|
|
|
|
|
158
|
push @{$self->{texts}}, shift; |
|
108
|
|
|
|
|
216
|
|
30
|
108
|
|
|
|
|
231
|
return $self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub render |
34
|
|
|
|
|
|
|
{ |
35
|
3078
|
|
|
3078
|
0
|
6251
|
my ($self) = @_; |
36
|
|
|
|
|
|
|
return $self->{need_join} |
37
|
11
|
|
|
|
|
64
|
? join '', @{$self->{texts}} |
38
|
3078
|
100
|
|
|
|
12406
|
: $self->{texts}->[0] |
39
|
|
|
|
|
|
|
; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |