| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package YAML::Conditional; |
|
2
|
14
|
|
|
14
|
|
1758629
|
use 5.006; use strict; use warnings; our $VERSION = '1.02'; |
|
|
14
|
|
|
14
|
|
53
|
|
|
|
14
|
|
|
14
|
|
73
|
|
|
|
14
|
|
|
|
|
45
|
|
|
|
14
|
|
|
|
|
477
|
|
|
|
14
|
|
|
|
|
68
|
|
|
|
14
|
|
|
|
|
35
|
|
|
|
14
|
|
|
|
|
1254
|
|
|
3
|
14
|
|
|
14
|
|
6205
|
use YAML::XS qw/Dump DumpFile Load LoadFile/; use base 'Struct::Conditional'; |
|
|
14
|
|
|
14
|
|
47636
|
|
|
|
14
|
|
|
|
|
1116
|
|
|
|
14
|
|
|
|
|
99
|
|
|
|
14
|
|
|
|
|
24
|
|
|
|
14
|
|
|
|
|
7147
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub encode { |
|
6
|
0
|
|
|
0
|
1
|
0
|
Dump($_[1]); |
|
7
|
|
|
|
|
|
|
} |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub encode_file { |
|
10
|
0
|
|
|
0
|
0
|
0
|
DumpFile($_[1], $_[2]); |
|
11
|
|
|
|
|
|
|
} |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub decode { |
|
14
|
15
|
50
|
33
|
15
|
1
|
109
|
if ($_[1] !~ m/\n/ && -f $_[1]) { |
|
15
|
0
|
|
|
|
|
0
|
return $_[0]->decode_file($_[1]); |
|
16
|
|
|
|
|
|
|
} |
|
17
|
15
|
|
|
|
|
2082
|
Load($_[1]); |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub decode_file { |
|
21
|
0
|
|
|
0
|
1
|
0
|
LoadFile($_[1], $_[2]); |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub compile { |
|
25
|
15
|
|
|
15
|
1
|
2393400
|
my ($self, $yaml, $params, $return_struct, $out_file) = @_; |
|
26
|
15
|
50
|
|
|
|
109
|
$yaml = $self->decode($yaml) unless ref $yaml; |
|
27
|
15
|
50
|
|
|
|
104
|
$params = $self->decode($params) unless ref $params; |
|
28
|
15
|
|
|
|
|
181
|
$yaml = $self->SUPER::compile($yaml, $params); |
|
29
|
15
|
0
|
|
|
|
10318
|
return $return_struct |
|
|
|
50
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
? $yaml |
|
31
|
|
|
|
|
|
|
: $out_file |
|
32
|
|
|
|
|
|
|
? $self->encode_file($out_file, $yaml) |
|
33
|
|
|
|
|
|
|
: $self->encode($yaml); |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |