line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package YAML::Mo; |
2
|
|
|
|
|
|
|
# use Mo qw[builder default import]; |
3
|
|
|
|
|
|
|
# The following line of code was produced from the previous line by |
4
|
|
|
|
|
|
|
# Mo::Inline version 0.4 |
5
|
49
|
100
|
33
|
49
|
|
489
|
no warnings;my$M=__PACKAGE__.'::';*{$M.Object::new}=sub{my$c=shift;my$s=bless{@_},$c;my%n=%{$c.'::'.':E'};map{$s->{$_}=$n{$_}->()if!exists$s->{$_}}keys%n;$s};*{$M.import}=sub{import warnings;$^H|=1538;my($P,%e,%o)=caller.'::';shift;eval"no Mo::$_",&{$M.$_.::e}($P,\%e,\%o,\@_)for@_;return if$e{M};%e=(extends,sub{eval"no $_[0]()";@{$P.ISA}=$_[0]},has,sub{my$n=shift;my$m=sub{$#_?$_[0]{$n}=$_[1]:$_[0]{$n}};@_=(default,@_)if!($#_%2);$m=$o{$_}->($m,$n,@_)for sort keys%o;*{$P.$n}=$m},%e,);*{$P.$_}=$e{$_}for keys%e;@{$P.ISA}=$M.Object};*{$M.'builder::e'}=sub{my($P,$e,$o)=@_;$o->{builder}=sub{my($m,$n,%a)=@_;my$b=$a{builder}or return$m;my$i=exists$a{lazy}?$a{lazy}:!${$P.':N'};$i or ${$P.':E'}{$n}=\&{$P.$b}and return$m;sub{$#_?$m->(@_):!exists$_[0]{$n}?$_[0]{$n}=$_[0]->$b:$m->(@_)}}};*{$M.'default::e'}=sub{my($P,$e,$o)=@_;$o->{default}=sub{my($m,$n,%a)=@_;exists$a{default}or return$m;my($d,$r)=$a{default};my$g='HASH'eq($r=ref$d)?sub{+{%$d}}:'ARRAY'eq$r?sub{[@$d]}:'CODE'eq$r?$d:sub{$d};my$i=exists$a{lazy}?$a{lazy}:!${$P.':N'};$i or ${$P.':E'}{$n}=$g and return$m;sub{$#_?$m->(@_):!exists$_[0]{$n}?$_[0]{$n}=$g->(@_):$m->(@_)}}};my$i=\&import;*{$M.import}=sub{(@_==2 and not$_[1])?pop@_:@_==1?push@_,grep!/import/,@f:();goto&$i};@f=qw[builder default import];use strict;use warnings; |
|
49
|
100
|
33
|
49
|
|
89
|
|
|
49
|
100
|
33
|
49
|
|
45130
|
|
|
49
|
100
|
|
49
|
|
383
|
|
|
49
|
100
|
|
49
|
|
109
|
|
|
49
|
100
|
|
48
|
|
1297
|
|
|
49
|
100
|
|
48
|
|
260
|
|
|
49
|
100
|
|
48
|
|
104
|
|
|
49
|
100
|
|
48
|
|
2650
|
|
|
49
|
100
|
|
48
|
|
7574
|
|
|
0
|
100
|
|
48
|
|
0
|
|
|
0
|
100
|
|
48
|
|
0
|
|
|
49
|
100
|
|
47
|
|
6455
|
|
|
0
|
100
|
|
47
|
|
0
|
|
|
0
|
50
|
|
23
|
|
0
|
|
|
48
|
100
|
|
23
|
|
7487
|
|
|
0
|
100
|
|
22
|
|
0
|
|
|
0
|
50
|
|
22
|
|
0
|
|
|
48
|
|
|
22
|
|
6964
|
|
|
0
|
|
|
3
|
|
0
|
|
|
0
|
|
|
3
|
|
0
|
|
|
48
|
|
|
1
|
|
6317
|
|
|
0
|
|
|
1
|
|
0
|
|
|
0
|
|
|
130172
|
|
0
|
|
|
48
|
|
|
|
|
6297
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
48
|
|
|
|
|
6523
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
48
|
|
|
|
|
6255
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
48
|
|
|
|
|
5992
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
21
|
|
|
47
|
|
|
|
|
6091
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
47
|
|
|
|
|
771
|
|
|
44
|
|
|
|
|
93
|
|
|
44
|
|
|
|
|
450
|
|
|
23
|
|
|
|
|
3335
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
23
|
|
|
|
|
2809
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
|
22
|
|
|
|
|
2957
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
22
|
|
|
|
|
2754
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
|
22
|
|
|
|
|
417
|
|
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
210
|
|
|
3
|
|
|
|
|
470
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
3
|
|
|
|
|
323
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
135
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
|
130172
|
|
|
|
|
240069
|
|
|
8606
|
|
|
|
|
37413
|
|
|
4182
|
|
|
|
|
12945
|
|
|
9672
|
|
|
|
|
25392
|
|
|
15244
|
|
|
|
|
43810
|
|
|
12605
|
|
|
|
|
32892
|
|
|
5199
|
|
|
|
|
15126
|
|
|
4555
|
|
|
|
|
10162
|
|
|
1450
|
|
|
|
|
4903
|
|
|
746
|
|
|
|
|
1881
|
|
|
1507
|
|
|
|
|
5087
|
|
|
7810
|
|
|
|
|
21064
|
|
|
1262
|
|
|
|
|
4365
|
|
|
8978
|
|
|
|
|
25635
|
|
|
11921
|
|
|
|
|
24832
|
|
|
10765
|
|
|
|
|
28267
|
|
|
834
|
|
|
|
|
2442
|
|
|
79805
|
|
|
|
|
209152
|
|
|
813
|
|
|
|
|
2203
|
|
|
728
|
|
|
|
|
2365
|
|
|
773
|
|
|
|
|
1923
|
|
|
834
|
|
|
|
|
3012
|
|
|
11614
|
|
|
|
|
21921
|
|
|
745
|
|
|
|
|
1981
|
|
|
861
|
|
|
|
|
2032
|
|
|
938
|
|
|
|
|
2250
|
|
|
6486
|
|
|
|
|
19549
|
|
|
1022
|
|
|
|
|
2199
|
|
|
751
|
|
|
|
|
3266
|
|
|
1050
|
|
|
|
|
2080
|
|
|
677
|
|
|
|
|
2860
|
|
|
1116
|
|
|
|
|
3340
|
|
|
822
|
|
|
|
|
1874
|
|
|
1078
|
|
|
|
|
3745
|
|
|
770
|
|
|
|
|
1845
|
|
|
722
|
|
|
|
|
2869
|
|
|
353
|
|
|
|
|
808
|
|
|
437
|
|
|
|
|
2172
|
|
|
937
|
|
|
|
|
1944
|
|
|
786
|
|
|
|
|
2022
|
|
|
928
|
|
|
|
|
2112
|
|
|
552
|
|
|
|
|
2095
|
|
|
884
|
|
|
|
|
4136
|
|
|
223
|
|
|
|
|
2143
|
|
|
621
|
|
|
|
|
4745
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $DumperModule = 'Data::Dumper'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my ($_new_error, $_info, $_scalar_info); |
10
|
|
|
|
|
|
|
|
11
|
49
|
|
|
49
|
|
359
|
no strict 'refs'; |
|
49
|
|
|
|
|
115
|
|
|
49
|
|
|
|
|
29351
|
|
12
|
|
|
|
|
|
|
*{$M.'Object::die'} = sub { |
13
|
39
|
|
|
39
|
|
108
|
my $self = shift; |
14
|
39
|
|
|
|
|
92
|
my $error = $self->$_new_error(@_); |
15
|
39
|
|
|
|
|
95
|
$error->type('Error'); |
16
|
39
|
|
|
|
|
104
|
Carp::croak($error->format_message); |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
*{$M.'Object::warn'} = sub { |
20
|
7
|
|
|
7
|
|
15
|
my $self = shift; |
21
|
7
|
50
|
|
|
|
26
|
return unless $^W; |
22
|
7
|
|
|
|
|
17
|
my $error = $self->$_new_error(@_); |
23
|
7
|
|
|
|
|
21
|
$error->type('Warning'); |
24
|
7
|
|
|
|
|
20
|
Carp::cluck($error->format_message); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# This code needs to be refactored to be simpler and more precise, and no, |
28
|
|
|
|
|
|
|
# Scalar::Util doesn't DWIM. |
29
|
|
|
|
|
|
|
# |
30
|
|
|
|
|
|
|
# Can't handle: |
31
|
|
|
|
|
|
|
# * blessed regexp |
32
|
|
|
|
|
|
|
*{$M.'Object::node_info'} = sub { |
33
|
3858
|
|
|
3858
|
|
4717
|
my $self = shift; |
34
|
3858
|
|
100
|
|
|
8982
|
my $stringify = $_[1] || 0; |
35
|
|
|
|
|
|
|
my ($class, $type, $id) = |
36
|
|
|
|
|
|
|
ref($_[0]) |
37
|
|
|
|
|
|
|
? $stringify |
38
|
|
|
|
|
|
|
? &$_info("$_[0]") |
39
|
3858
|
100
|
|
|
|
7191
|
: do { |
|
|
100
|
|
|
|
|
|
40
|
3834
|
|
|
|
|
12321
|
require overload; |
41
|
3834
|
|
|
|
|
7719
|
my @info = &$_info(overload::StrVal($_[0])); |
42
|
3834
|
100
|
|
|
|
9139
|
if (ref($_[0]) eq 'Regexp') { |
43
|
1
|
|
|
|
|
5
|
@info[0, 1] = (undef, 'REGEXP'); |
44
|
|
|
|
|
|
|
} |
45
|
3834
|
|
|
|
|
8800
|
@info; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
: &$_scalar_info($_[0]); |
48
|
3858
|
100
|
|
|
|
6481
|
($class, $type, $id) = &$_scalar_info("$_[0]") |
49
|
|
|
|
|
|
|
unless $id; |
50
|
3858
|
50
|
|
|
|
11212
|
return wantarray ? ($class, $type, $id) : $id; |
51
|
|
|
|
|
|
|
}; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
54
|
|
|
|
|
|
|
$_info = sub { |
55
|
|
|
|
|
|
|
return (($_[0]) =~ qr{^(?:(.*)\=)?([^=]*)\(([^\(]*)\)$}o); |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
$_scalar_info = sub { |
59
|
|
|
|
|
|
|
my $id = 'undef'; |
60
|
|
|
|
|
|
|
if (defined $_[0]) { |
61
|
|
|
|
|
|
|
\$_[0] =~ /\((\w+)\)$/o or CORE::die(); |
62
|
|
|
|
|
|
|
$id = "$1-S"; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
return (undef, undef, $id); |
65
|
|
|
|
|
|
|
}; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
$_new_error = sub { |
68
|
|
|
|
|
|
|
require Carp; |
69
|
|
|
|
|
|
|
my $self = shift; |
70
|
|
|
|
|
|
|
require YAML::Error; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
my $code = shift || 'unknown error'; |
73
|
|
|
|
|
|
|
my $error = YAML::Error->new(code => $code); |
74
|
|
|
|
|
|
|
$error->line($self->line) if $self->can('line'); |
75
|
|
|
|
|
|
|
$error->document($self->document) if $self->can('document'); |
76
|
|
|
|
|
|
|
$error->arguments([@_]); |
77
|
|
|
|
|
|
|
return $error; |
78
|
|
|
|
|
|
|
}; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |