line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Reverse::Converter::TT2; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Convert parts to TT2 format simply |
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
4087
|
use Moo; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
26
|
|
6
|
4
|
|
|
4
|
|
1322
|
use Scalar::Util qw(blessed); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
1161
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.143'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub Convert{ |
10
|
10
|
|
|
10
|
0
|
923
|
my $self = shift; |
11
|
10
|
|
|
|
|
12
|
my $parts = shift; |
12
|
10
|
|
|
|
|
13
|
my @temps; |
13
|
|
|
|
|
|
|
|
14
|
10
|
|
|
|
|
14
|
foreach my $pat (@{$parts}){ |
|
10
|
|
|
|
|
20
|
|
15
|
15
|
|
|
|
|
18
|
my @pre = @{$pat->pre}; |
|
15
|
|
|
|
|
62
|
|
16
|
15
|
|
|
|
|
21
|
my @post = @{$pat->post}; |
|
15
|
|
|
|
|
38
|
|
17
|
|
|
|
|
|
|
|
18
|
15
|
50
|
|
|
|
24
|
@pre = map{blessed($_)?$_->as_string:$_}@pre; |
|
49
|
|
|
|
|
123
|
|
19
|
15
|
50
|
|
|
|
25
|
@post= map{blessed($_)?$_->as_string:$_}@post; |
|
40
|
|
|
|
|
92
|
|
20
|
15
|
|
|
|
|
30
|
my $pretxt = join '',@pre; |
21
|
15
|
|
|
|
|
23
|
my $posttxt = join '',@post; |
22
|
15
|
100
|
|
|
|
31
|
$pretxt .= '' if $pretxt; |
23
|
15
|
100
|
|
|
|
34
|
$posttxt = ''.$posttxt if $posttxt; |
24
|
15
|
|
|
|
|
50
|
push(@temps,$pretxt."[\% value \%]".$posttxt); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
10
|
|
|
|
|
56
|
return \@temps; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |