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
|
|
495
|
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
|
|
81
|
|
|
49
|
100
|
33
|
49
|
|
42852
|
|
|
49
|
100
|
|
49
|
|
345
|
|
|
49
|
100
|
|
49
|
|
89
|
|
|
49
|
100
|
|
48
|
|
1183
|
|
|
49
|
100
|
|
48
|
|
222
|
|
|
49
|
100
|
|
48
|
|
97
|
|
|
49
|
100
|
|
48
|
|
2449
|
|
|
49
|
100
|
|
48
|
|
6522
|
|
|
0
|
100
|
|
48
|
|
0
|
|
|
0
|
100
|
|
48
|
|
0
|
|
|
49
|
100
|
|
47
|
|
6130
|
|
|
0
|
100
|
|
47
|
|
0
|
|
|
0
|
100
|
|
23
|
|
0
|
|
|
48
|
100
|
|
23
|
|
6059
|
|
|
0
|
100
|
|
22
|
|
0
|
|
|
0
|
50
|
|
22
|
|
0
|
|
|
48
|
|
|
22
|
|
5646
|
|
|
0
|
|
|
3
|
|
0
|
|
|
0
|
|
|
3
|
|
0
|
|
|
48
|
|
|
1
|
|
5800
|
|
|
0
|
|
|
1
|
|
0
|
|
|
0
|
|
|
119224
|
|
0
|
|
|
48
|
|
|
|
|
5674
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
48
|
|
|
|
|
5644
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
48
|
|
|
|
|
5556
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
48
|
|
|
|
|
5370
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
20
|
|
|
47
|
|
|
|
|
5466
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
47
|
|
|
|
|
628
|
|
|
44
|
|
|
|
|
81
|
|
|
44
|
|
|
|
|
418
|
|
|
23
|
|
|
|
|
2855
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
23
|
|
|
|
|
2584
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
|
22
|
|
|
|
|
2674
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
22
|
|
|
|
|
2422
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
|
22
|
|
|
|
|
367
|
|
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
189
|
|
|
3
|
|
|
|
|
445
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
3
|
|
|
|
|
280
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
138
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
119224
|
|
|
|
|
247325
|
|
|
89327
|
|
|
|
|
154597
|
|
|
22356
|
|
|
|
|
56112
|
|
|
18727
|
|
|
|
|
44090
|
|
|
2021
|
|
|
|
|
5566
|
|
|
997
|
|
|
|
|
2194
|
|
|
6171
|
|
|
|
|
15966
|
|
|
21035
|
|
|
|
|
37637
|
|
|
2073
|
|
|
|
|
6471
|
|
|
968
|
|
|
|
|
1883
|
|
|
1412
|
|
|
|
|
13870
|
|
|
2161
|
|
|
|
|
4708
|
|
|
13487
|
|
|
|
|
35562
|
|
|
2715
|
|
|
|
|
7437
|
|
|
2288
|
|
|
|
|
5594
|
|
|
15235
|
|
|
|
|
36047
|
|
|
1842
|
|
|
|
|
4208
|
|
|
809
|
|
|
|
|
3009
|
|
|
839
|
|
|
|
|
1947
|
|
|
769
|
|
|
|
|
2234
|
|
|
886
|
|
|
|
|
1749
|
|
|
797
|
|
|
|
|
2678
|
|
|
1600
|
|
|
|
|
3629
|
|
|
632
|
|
|
|
|
2011
|
|
|
2402
|
|
|
|
|
7776
|
|
|
1131
|
|
|
|
|
2513
|
|
|
1168
|
|
|
|
|
3959
|
|
|
1138
|
|
|
|
|
2292
|
|
|
950
|
|
|
|
|
3636
|
|
|
6169
|
|
|
|
|
14774
|
|
|
726
|
|
|
|
|
1837
|
|
|
1641
|
|
|
|
|
4370
|
|
|
703
|
|
|
|
|
1569
|
|
|
936
|
|
|
|
|
3233
|
|
|
617
|
|
|
|
|
1290
|
|
|
680
|
|
|
|
|
3730
|
|
|
777
|
|
|
|
|
32712
|
|
|
697
|
|
|
|
|
2464
|
|
|
854
|
|
|
|
|
2477
|
|
|
709
|
|
|
|
|
1786
|
|
|
1012
|
|
|
|
|
2166
|
|
|
543
|
|
|
|
|
1676
|
|
|
856
|
|
|
|
|
2358
|
|
|
258
|
|
|
|
|
979
|
|
|
595
|
|
|
|
|
4125
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $DumperModule = 'Data::Dumper'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my ($_new_error, $_info, $_scalar_info); |
10
|
|
|
|
|
|
|
|
11
|
49
|
|
|
49
|
|
263
|
no strict 'refs'; |
|
49
|
|
|
|
|
107
|
|
|
49
|
|
|
|
|
27347
|
|
12
|
|
|
|
|
|
|
*{$M.'Object::die'} = sub { |
13
|
39
|
|
|
39
|
|
89
|
my $self = shift; |
14
|
39
|
|
|
|
|
68
|
my $error = $self->$_new_error(@_); |
15
|
39
|
|
|
|
|
74
|
$error->type('Error'); |
16
|
39
|
|
|
|
|
85
|
Carp::croak($error->format_message); |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
*{$M.'Object::warn'} = sub { |
20
|
7
|
|
|
7
|
|
9
|
my $self = shift; |
21
|
7
|
50
|
|
|
|
20
|
return unless $^W; |
22
|
7
|
|
|
|
|
16
|
my $error = $self->$_new_error(@_); |
23
|
7
|
|
|
|
|
14
|
$error->type('Warning'); |
24
|
7
|
|
|
|
|
14
|
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
|
3846
|
|
|
3846
|
|
4264
|
my $self = shift; |
34
|
3846
|
|
100
|
|
|
8113
|
my $stringify = $_[1] || 0; |
35
|
|
|
|
|
|
|
my ($class, $type, $id) = |
36
|
|
|
|
|
|
|
ref($_[0]) |
37
|
|
|
|
|
|
|
? $stringify |
38
|
|
|
|
|
|
|
? &$_info("$_[0]") |
39
|
3846
|
100
|
|
|
|
6475
|
: do { |
|
|
100
|
|
|
|
|
|
40
|
3822
|
|
|
|
|
11108
|
require overload; |
41
|
3822
|
|
|
|
|
7093
|
my @info = &$_info(overload::StrVal($_[0])); |
42
|
3822
|
100
|
|
|
|
8489
|
if (ref($_[0]) eq 'Regexp') { |
43
|
1
|
|
|
|
|
5
|
@info[0, 1] = (undef, 'REGEXP'); |
44
|
|
|
|
|
|
|
} |
45
|
3822
|
|
|
|
|
7925
|
@info; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
: &$_scalar_info($_[0]); |
48
|
3846
|
100
|
|
|
|
6071
|
($class, $type, $id) = &$_scalar_info("$_[0]") |
49
|
|
|
|
|
|
|
unless $id; |
50
|
3846
|
50
|
|
|
|
10202
|
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; |