line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Tag::Sprintf; |
2
|
2
|
|
|
2
|
|
759
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
59
|
|
3
|
2
|
|
|
2
|
|
12
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
51
|
|
4
|
2
|
|
|
2
|
|
72
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
67
|
|
5
|
2
|
|
|
2
|
|
10
|
use parent 'DTL::Fast::Tag::Simple'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
9
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$DTL::Fast::TAG_HANDLERS{sprintf} = __PACKAGE__; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#@Override |
10
|
|
|
|
|
|
|
sub parse_parameters |
11
|
|
|
|
|
|
|
{ |
12
|
3
|
|
|
3
|
0
|
5
|
my $self = shift; |
13
|
3
|
|
|
|
|
13
|
$self->{parameters} = $self->parse_sources($self->{parameter}); |
14
|
3
|
|
|
|
|
6
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#@Override |
18
|
|
|
|
|
|
|
sub render |
19
|
|
|
|
|
|
|
{ |
20
|
3
|
|
|
3
|
0
|
7
|
my ( $self, $context, $global_safe) = @_; |
21
|
3
|
|
|
|
|
7
|
my $result = ''; |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
7
|
my @parameters = (); |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
7
|
foreach my $parameter (@{$self->{parameters}}) |
|
3
|
|
|
|
|
6
|
|
26
|
|
|
|
|
|
|
{ |
27
|
9
|
|
50
|
|
|
27
|
push @parameters, $parameter->render($context) // ''; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
|
|
47
|
return sprintf shift @parameters, @parameters; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |