line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
50
|
|
|
50
|
|
265640
|
use strict; use warnings; |
|
50
|
|
|
50
|
|
127
|
|
|
50
|
|
|
|
|
1153
|
|
|
50
|
|
|
|
|
214
|
|
|
50
|
|
|
|
|
97
|
|
|
50
|
|
|
|
|
3257
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package YAML::Safe; |
4
|
|
|
|
|
|
|
our $VERSION = '0.81'; |
5
|
|
|
|
|
|
|
our $XS_VERSION = $VERSION; |
6
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
7
|
|
|
|
|
|
|
|
8
|
50
|
|
|
50
|
|
351
|
use base 'Exporter'; |
|
50
|
|
|
|
|
101
|
|
|
50
|
|
|
|
|
1008
|
|
9
|
|
|
|
|
|
|
@YAML::Safe::EXPORT = qw(Load Dump); |
10
|
|
|
|
|
|
|
@YAML::Safe::EXPORT_OK = qw(LoadFile DumpFile); |
11
|
|
|
|
|
|
|
%YAML::Safe::EXPORT_TAGS = ( |
12
|
|
|
|
|
|
|
all => [qw(Dump Load LoadFile DumpFile)], |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
50
|
|
|
50
|
|
316
|
use XSLoader; |
|
50
|
|
|
|
|
94
|
|
|
50
|
|
|
|
|
30809
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# XXX The following code should be moved from Perl to C. |
18
|
|
|
|
|
|
|
$YAML::Safe::coderef2text = sub { |
19
|
|
|
|
|
|
|
my $coderef = shift; |
20
|
|
|
|
|
|
|
require B::Deparse; |
21
|
|
|
|
|
|
|
my $deparse = B::Deparse->new(); |
22
|
|
|
|
|
|
|
my $text; |
23
|
|
|
|
|
|
|
eval { |
24
|
|
|
|
|
|
|
local $^W = 0; |
25
|
|
|
|
|
|
|
$text = $deparse->coderef2text($coderef); |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
if ($@) { |
28
|
|
|
|
|
|
|
warn "YAML::Safe failed to dump code ref:\n$@"; |
29
|
|
|
|
|
|
|
return; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
$text =~ s[BEGIN \{\$\{\^WARNING_BITS\} = "UUUUUUUUUUUU\\001"\}] |
32
|
|
|
|
|
|
|
[use warnings;]g; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
return $text; |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$YAML::Safe::glob2hash = sub { |
38
|
|
|
|
|
|
|
my $hash = {}; |
39
|
|
|
|
|
|
|
for my $type (qw(PACKAGE NAME SCALAR ARRAY HASH CODE IO)) { |
40
|
|
|
|
|
|
|
my $value = *{$_[0]}{$type}; |
41
|
|
|
|
|
|
|
$value = $$value if $type eq 'SCALAR'; |
42
|
|
|
|
|
|
|
if (defined $value) { |
43
|
|
|
|
|
|
|
if ($type eq 'IO') { |
44
|
|
|
|
|
|
|
my @stats = qw(device inode mode links uid gid rdev size |
45
|
|
|
|
|
|
|
atime mtime ctime blksize blocks); |
46
|
|
|
|
|
|
|
undef $value; |
47
|
|
|
|
|
|
|
$value->{stat} = {}; |
48
|
|
|
|
|
|
|
map {$value->{stat}{shift @stats} = $_} stat(*{$_[0]}); |
49
|
|
|
|
|
|
|
$value->{fileno} = fileno(*{$_[0]}); |
50
|
|
|
|
|
|
|
{ |
51
|
|
|
|
|
|
|
local $^W; |
52
|
|
|
|
|
|
|
$value->{tell} = tell(*{$_[0]}); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
$hash->{$type} = $value; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
return $hash; |
59
|
|
|
|
|
|
|
}; |
60
|
|
|
|
|
|
|
|
61
|
5
|
|
|
|
|
54
|
use constant _QR_MAP => { |
62
|
0
|
|
|
|
|
0
|
'' => sub { qr{$_[0]} }, |
63
|
0
|
|
|
|
|
0
|
x => sub { qr{$_[0]}x }, |
64
|
0
|
|
|
|
|
0
|
i => sub { qr{$_[0]}i }, |
65
|
0
|
|
|
|
|
0
|
s => sub { qr{$_[0]}s }, |
66
|
0
|
|
|
|
|
0
|
m => sub { qr{$_[0]}m }, |
67
|
0
|
|
|
|
|
0
|
ix => sub { qr{$_[0]}ix }, |
68
|
0
|
|
|
|
|
0
|
sx => sub { qr{$_[0]}sx }, |
69
|
0
|
|
|
|
|
0
|
mx => sub { qr{$_[0]}mx }, |
70
|
1
|
|
|
|
|
11
|
si => sub { qr{$_[0]}si }, |
71
|
0
|
|
|
|
|
0
|
mi => sub { qr{$_[0]}mi }, |
72
|
0
|
|
|
|
|
0
|
ms => sub { qr{$_[0]}sm }, |
73
|
0
|
|
|
|
|
0
|
six => sub { qr{$_[0]}six }, |
74
|
0
|
|
|
|
|
0
|
mix => sub { qr{$_[0]}mix }, |
75
|
0
|
|
|
|
|
0
|
msx => sub { qr{$_[0]}msx }, |
76
|
2
|
|
|
|
|
45
|
msi => sub { qr{$_[0]}msi }, |
77
|
50
|
|
|
50
|
|
345
|
msix => sub { qr{$_[0]}msix }, |
|
50
|
|
|
|
|
100
|
|
|
50
|
|
|
|
|
15952
|
|
78
|
|
|
|
|
|
|
}; |
79
|
|
|
|
|
|
|
|
80
|
11
|
100
|
|
11
|
|
13262
|
sub __qr_loader { |
81
|
8
|
|
|
|
|
29
|
if ($_[0] =~ /\A \(\? ([\^uixsm]*) (?:- (?:[ixsm]*))? : (.*) \) \z/x) { |
82
|
8
|
|
|
|
|
30
|
my ($flags, $re) = ($1, $2); |
83
|
8
|
|
|
|
|
18
|
$flags =~ s/^\^//; |
84
|
8
|
|
33
|
|
|
28
|
$flags =~ tr/u//d; |
85
|
8
|
|
|
|
|
53
|
my $sub = _QR_MAP->{$flags} || _QR_MAP->{''}; |
86
|
8
|
|
|
|
|
22733
|
my $qr = &$sub($re); |
87
|
|
|
|
|
|
|
return $qr; |
88
|
3
|
|
|
|
|
69
|
} |
89
|
|
|
|
|
|
|
return qr/$_[0]/; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
5
|
|
|
5
|
|
331
|
sub __code_loader { |
93
|
5
|
|
|
2
|
|
296
|
my ($string) = @_; |
|
2
|
|
|
1
|
|
535
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
40
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
94
|
5
|
50
|
|
|
|
15
|
my $sub = eval "sub $string"; |
95
|
0
|
|
|
|
|
0
|
if ($@) { |
96
|
0
|
|
|
0
|
|
0
|
warn "YAML::Safe failed to load sub: $@"; |
97
|
|
|
|
|
|
|
return sub {}; |
98
|
5
|
|
|
|
|
92
|
} |
99
|
|
|
|
|
|
|
return $sub; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
XSLoader::load 'YAML::Safe', $XS_VERSION; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
1; |
105
|
|
|
|
|
|
|
__END__ |