line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Text; |
2
|
98
|
|
|
98
|
|
524
|
use strict; use utf8; use warnings FATAL => 'all'; |
|
98
|
|
|
98
|
|
190
|
|
|
98
|
|
|
98
|
|
2663
|
|
|
98
|
|
|
|
|
504
|
|
|
98
|
|
|
|
|
184
|
|
|
98
|
|
|
|
|
585
|
|
|
98
|
|
|
|
|
2443
|
|
|
98
|
|
|
|
|
187
|
|
|
98
|
|
|
|
|
3901
|
|
3
|
|
|
|
|
|
|
|
4
|
98
|
|
|
98
|
|
576
|
use DTL::Fast::Template; |
|
98
|
|
|
|
|
171
|
|
|
98
|
|
|
|
|
2429
|
|
5
|
98
|
|
|
98
|
|
498
|
use Scalar::Util qw/weaken/; |
|
98
|
|
|
|
|
169
|
|
|
98
|
|
|
|
|
25465
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new |
8
|
|
|
|
|
|
|
{ |
9
|
2392
|
|
|
2392
|
0
|
3865
|
my ($proto, $text ) = @_; |
10
|
2392
|
|
100
|
|
|
5062
|
$text //= ''; |
11
|
|
|
|
|
|
|
|
12
|
2392
|
|
|
|
|
9412
|
my $self = bless { |
13
|
|
|
|
|
|
|
'texts' => [$text] |
14
|
|
|
|
|
|
|
, '_template' => $DTL::Fast::Template::CURRENT_TEMPLATE |
15
|
|
|
|
|
|
|
, '_template_line' => $DTL::Fast::Template::CURRENT_TEMPLATE_LINE |
16
|
|
|
|
|
|
|
}, $proto; |
17
|
|
|
|
|
|
|
|
18
|
2392
|
|
|
|
|
6053
|
weaken $self->{'_template'}; |
19
|
|
|
|
|
|
|
|
20
|
2392
|
|
|
|
|
6023
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub append |
24
|
|
|
|
|
|
|
{ |
25
|
108
|
|
|
108
|
0
|
144
|
my $self = shift; |
26
|
108
|
|
100
|
|
|
306
|
$self->{'need_join'} ||= 1; |
27
|
108
|
|
|
|
|
132
|
push @{$self->{'texts'}}, shift; |
|
108
|
|
|
|
|
235
|
|
28
|
108
|
|
|
|
|
233
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub render |
32
|
|
|
|
|
|
|
{ |
33
|
3078
|
|
|
3078
|
0
|
5412
|
my($self) = @_; |
34
|
|
|
|
|
|
|
return $self->{'need_join'} |
35
|
11
|
|
|
|
|
63
|
? join '', @{$self->{'texts'}} |
36
|
3078
|
100
|
|
|
|
17388
|
: $self->{'texts'}->[0] |
37
|
|
|
|
|
|
|
; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |