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
|
3
|
|
|
3
|
|
3566
|
use Moo; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
28
|
|
6
|
3
|
|
|
3
|
|
1069
|
use utf8; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
27
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.202'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub Convert{ |
10
|
10
|
|
|
10
|
0
|
61
|
my $self = shift; |
11
|
10
|
|
|
|
|
17
|
my $parts = shift; |
12
|
10
|
|
|
|
|
19
|
my @temps; |
13
|
|
|
|
|
|
|
|
14
|
10
|
|
|
|
|
22
|
foreach my $pat (@{$parts}){ |
|
10
|
|
|
|
|
26
|
|
15
|
15
|
|
|
|
|
21
|
my @pre = @{$pat->{pre}}; |
|
15
|
|
|
|
|
36
|
|
16
|
15
|
|
|
|
|
23
|
my @post = @{$pat->{post}}; |
|
15
|
|
|
|
|
31
|
|
17
|
|
|
|
|
|
|
|
18
|
15
|
|
|
|
|
28
|
@pre = grep{!ref($_)}@pre; |
|
40
|
|
|
|
|
85
|
|
19
|
15
|
|
|
|
|
26
|
@post= grep{!ref($_)}@post; |
|
37
|
|
|
|
|
78
|
|
20
|
15
|
|
|
|
|
34
|
my $pretxt = join '',@pre; |
21
|
15
|
|
|
|
|
26
|
my $posttxt = join '',@post; |
22
|
15
|
100
|
|
|
|
39
|
$pretxt .= '' if $pretxt; |
23
|
15
|
100
|
|
|
|
39
|
$posttxt = ''.$posttxt if $posttxt; |
24
|
15
|
|
|
|
|
48
|
push(@temps,$pretxt."[\% value \%]".$posttxt); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
10
|
|
|
|
|
24
|
return \@temps; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |