line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Faster backend for YAML::PP |
2
|
|
|
|
|
|
|
package YAML::PP::LibYAML; |
3
|
1
|
|
|
1
|
|
141729
|
use strict; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.004'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
7
|
use base qw/ YAML::PP Exporter /; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
180
|
|
9
|
|
|
|
|
|
|
our @EXPORT_OK = qw/ Load Dump LoadFile DumpFile /; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
485
|
use YAML::PP::LibYAML::Parser; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
12
|
1
|
|
|
1
|
|
422
|
use YAML::PP::LibYAML::Emitter; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
250
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
2
|
|
|
2
|
1
|
1900
|
my ($class, %args) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $self = $class->SUPER::new( |
18
|
|
|
|
|
|
|
parser => YAML::PP::LibYAML::Parser->new, |
19
|
|
|
|
|
|
|
emitter => YAML::PP::LibYAML::Emitter->new( |
20
|
|
|
|
|
|
|
indent => delete $args{indent}, |
21
|
2
|
|
|
|
|
13
|
), |
22
|
|
|
|
|
|
|
%args, |
23
|
|
|
|
|
|
|
); |
24
|
2
|
|
|
|
|
5407
|
return $self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# legacy interface |
28
|
|
|
|
|
|
|
sub Load { |
29
|
0
|
|
|
0
|
1
|
|
my ($yaml) = @_; |
30
|
0
|
|
|
|
|
|
YAML::PP::LibYAML->new->load_string($yaml); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub LoadFile { |
34
|
0
|
|
|
0
|
1
|
|
my ($file) = @_; |
35
|
0
|
|
|
|
|
|
YAML::PP::LibYAML->new->load_file($file); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub Dump { |
39
|
0
|
|
|
0
|
1
|
|
my (@data) = @_; |
40
|
0
|
|
|
|
|
|
YAML::PP::LibYAML->new->dump_string(@data); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub DumpFile { |
44
|
0
|
|
|
0
|
1
|
|
my ($file, @data) = @_; |
45
|
0
|
|
|
|
|
|
YAML::PP::LibYAML->new->dump_file($file, @data); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |