line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Faster backend for YAML::PP |
2
|
|
|
|
|
|
|
package YAML::PP::LibYAML; |
3
|
2
|
|
|
2
|
|
205235
|
use strict; |
|
2
|
|
|
|
|
21
|
|
|
2
|
|
|
|
|
60
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
92
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.005'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
12
|
use base qw/ YAML::PP Exporter /; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
726
|
|
9
|
|
|
|
|
|
|
our @EXPORT_OK = qw/ Load Dump LoadFile DumpFile /; |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
69220
|
use YAML::PP::LibYAML::Parser; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
58
|
|
12
|
2
|
|
|
2
|
|
870
|
use YAML::PP::LibYAML::Emitter; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
374
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
4
|
|
|
4
|
1
|
2719
|
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
|
|
|
|
|
|
|
width => delete $args{width}, |
22
|
4
|
|
|
|
|
33
|
), |
23
|
|
|
|
|
|
|
%args, |
24
|
|
|
|
|
|
|
); |
25
|
4
|
|
|
|
|
10889
|
return $self; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# legacy interface |
29
|
|
|
|
|
|
|
sub Load { |
30
|
0
|
|
|
0
|
1
|
|
my ($yaml) = @_; |
31
|
0
|
|
|
|
|
|
YAML::PP::LibYAML->new->load_string($yaml); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub LoadFile { |
35
|
0
|
|
|
0
|
1
|
|
my ($file) = @_; |
36
|
0
|
|
|
|
|
|
YAML::PP::LibYAML->new->load_file($file); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub Dump { |
40
|
0
|
|
|
0
|
1
|
|
my (@data) = @_; |
41
|
0
|
|
|
|
|
|
YAML::PP::LibYAML->new->dump_string(@data); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub DumpFile { |
45
|
0
|
|
|
0
|
1
|
|
my ($file, @data) = @_; |
46
|
0
|
|
|
|
|
|
YAML::PP::LibYAML->new->dump_file($file, @data); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |