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
|
|
482
|
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
|
|
84
|
|
|
49
|
100
|
33
|
49
|
|
45763
|
|
|
49
|
100
|
|
49
|
|
377
|
|
|
49
|
100
|
|
49
|
|
89
|
|
|
49
|
100
|
|
48
|
|
1452
|
|
|
49
|
100
|
|
48
|
|
260
|
|
|
49
|
100
|
|
48
|
|
92
|
|
|
49
|
100
|
|
48
|
|
2643
|
|
|
49
|
100
|
|
48
|
|
7749
|
|
|
0
|
100
|
|
48
|
|
0
|
|
|
0
|
100
|
|
48
|
|
0
|
|
|
49
|
100
|
|
47
|
|
6343
|
|
|
0
|
100
|
|
47
|
|
0
|
|
|
0
|
50
|
|
23
|
|
0
|
|
|
48
|
100
|
|
23
|
|
7193
|
|
|
0
|
100
|
|
22
|
|
0
|
|
|
0
|
50
|
|
22
|
|
0
|
|
|
48
|
|
|
22
|
|
6319
|
|
|
0
|
|
|
3
|
|
0
|
|
|
0
|
|
|
3
|
|
0
|
|
|
48
|
|
|
1
|
|
6445
|
|
|
0
|
|
|
1
|
|
0
|
|
|
0
|
|
|
138433
|
|
0
|
|
|
48
|
|
|
|
|
6148
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
48
|
|
|
|
|
6337
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
48
|
|
|
|
|
6151
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
48
|
|
|
|
|
6027
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
22
|
|
|
47
|
|
|
|
|
6131
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
47
|
|
|
|
|
769
|
|
|
44
|
|
|
|
|
104
|
|
|
44
|
|
|
|
|
443
|
|
|
23
|
|
|
|
|
3385
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
23
|
|
|
|
|
2785
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
11
|
|
|
22
|
|
|
|
|
2946
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
22
|
|
|
|
|
2671
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
22
|
|
|
|
|
439
|
|
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
201
|
|
|
3
|
|
|
|
|
485
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
3
|
|
|
|
|
331
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
150
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
138433
|
|
|
|
|
248666
|
|
|
33445
|
|
|
|
|
100740
|
|
|
2744
|
|
|
|
|
8706
|
|
|
10782
|
|
|
|
|
30525
|
|
|
3376
|
|
|
|
|
7831
|
|
|
1083
|
|
|
|
|
2633
|
|
|
80031
|
|
|
|
|
180859
|
|
|
2612
|
|
|
|
|
7297
|
|
|
2153
|
|
|
|
|
6061
|
|
|
846
|
|
|
|
|
2539
|
|
|
7864
|
|
|
|
|
20340
|
|
|
12690
|
|
|
|
|
23057
|
|
|
3504
|
|
|
|
|
10299
|
|
|
1179
|
|
|
|
|
3257
|
|
|
1889
|
|
|
|
|
12550
|
|
|
2034
|
|
|
|
|
5414
|
|
|
805
|
|
|
|
|
1967
|
|
|
12299
|
|
|
|
|
31643
|
|
|
7087
|
|
|
|
|
21712
|
|
|
1035
|
|
|
|
|
3096
|
|
|
3096
|
|
|
|
|
5811
|
|
|
879
|
|
|
|
|
3834
|
|
|
4197
|
|
|
|
|
12466
|
|
|
885
|
|
|
|
|
2705
|
|
|
831
|
|
|
|
|
2073
|
|
|
932
|
|
|
|
|
33363
|
|
|
1115
|
|
|
|
|
3461
|
|
|
966
|
|
|
|
|
2615
|
|
|
1043
|
|
|
|
|
3951
|
|
|
1765
|
|
|
|
|
4460
|
|
|
513
|
|
|
|
|
1219
|
|
|
1069
|
|
|
|
|
2762
|
|
|
946
|
|
|
|
|
2081
|
|
|
898
|
|
|
|
|
2381
|
|
|
949
|
|
|
|
|
2346
|
|
|
803
|
|
|
|
|
4245
|
|
|
756
|
|
|
|
|
2418
|
|
|
837
|
|
|
|
|
2959
|
|
|
983
|
|
|
|
|
2023
|
|
|
697
|
|
|
|
|
1728
|
|
|
1037
|
|
|
|
|
2315
|
|
|
351
|
|
|
|
|
1180
|
|
|
742
|
|
|
|
|
3943
|
|
|
205
|
|
|
|
|
1020
|
|
|
448
|
|
|
|
|
4473
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $DumperModule = 'Data::Dumper'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my ($_new_error, $_info, $_scalar_info); |
10
|
|
|
|
|
|
|
|
11
|
49
|
|
|
49
|
|
298
|
no strict 'refs'; |
|
49
|
|
|
|
|
109
|
|
|
49
|
|
|
|
|
29340
|
|
12
|
|
|
|
|
|
|
*{$M.'Object::die'} = sub { |
13
|
39
|
|
|
39
|
|
103
|
my $self = shift; |
14
|
39
|
|
|
|
|
95
|
my $error = $self->$_new_error(@_); |
15
|
39
|
|
|
|
|
86
|
$error->type('Error'); |
16
|
39
|
|
|
|
|
111
|
Carp::croak($error->format_message); |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
*{$M.'Object::warn'} = sub { |
20
|
7
|
|
|
7
|
|
11
|
my $self = shift; |
21
|
7
|
50
|
|
|
|
24
|
return unless $^W; |
22
|
7
|
|
|
|
|
16
|
my $error = $self->$_new_error(@_); |
23
|
7
|
|
|
|
|
18
|
$error->type('Warning'); |
24
|
7
|
|
|
|
|
24
|
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
|
|
5015
|
my $self = shift; |
34
|
3858
|
|
100
|
|
|
8947
|
my $stringify = $_[1] || 0; |
35
|
|
|
|
|
|
|
my ($class, $type, $id) = |
36
|
|
|
|
|
|
|
ref($_[0]) |
37
|
|
|
|
|
|
|
? $stringify |
38
|
|
|
|
|
|
|
? &$_info("$_[0]") |
39
|
3858
|
100
|
|
|
|
6948
|
: do { |
|
|
100
|
|
|
|
|
|
40
|
3834
|
|
|
|
|
11956
|
require overload; |
41
|
3834
|
|
|
|
|
7793
|
my @info = &$_info(overload::StrVal($_[0])); |
42
|
3834
|
100
|
|
|
|
8868
|
if (ref($_[0]) eq 'Regexp') { |
43
|
1
|
|
|
|
|
5
|
@info[0, 1] = (undef, 'REGEXP'); |
44
|
|
|
|
|
|
|
} |
45
|
3834
|
|
|
|
|
8675
|
@info; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
: &$_scalar_info($_[0]); |
48
|
3858
|
100
|
|
|
|
6512
|
($class, $type, $id) = &$_scalar_info("$_[0]") |
49
|
|
|
|
|
|
|
unless $id; |
50
|
3858
|
50
|
|
|
|
11058
|
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; |