line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#line 1 |
2
|
|
|
|
|
|
|
package YAML::Mo; $VERSION = '0.80'; |
3
|
|
|
|
|
|
|
# use Mo qw[builder default import]; |
4
|
|
|
|
|
|
|
# The following line of code was produced from the previous line by |
5
|
2
|
100
|
33
|
2
|
|
11
|
# Mo::Inline version 0.27 |
|
2
|
100
|
|
2
|
|
23
|
|
|
2
|
100
|
|
2
|
|
1746
|
|
|
2
|
50
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
82
|
|
|
2
|
100
|
|
2
|
|
11
|
|
|
2
|
50
|
|
2
|
|
3
|
|
|
2
|
50
|
|
2
|
|
158
|
|
|
2
|
|
|
2
|
|
897
|
|
|
0
|
|
|
2
|
|
0
|
|
|
0
|
|
|
2
|
|
0
|
|
|
2
|
|
|
2
|
|
860
|
|
|
0
|
|
|
2
|
|
0
|
|
|
0
|
|
|
42
|
|
0
|
|
|
2
|
|
|
|
|
769
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
638
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
817
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
672
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
642
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
579
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
756
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
708
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
19
|
|
|
42
|
|
|
|
|
73
|
|
|
42
|
|
|
|
|
99
|
|
|
16888
|
|
|
|
|
76106
|
|
|
16891
|
|
|
|
|
49859
|
|
|
26
|
|
|
|
|
43
|
|
|
26
|
|
|
|
|
432
|
|
|
16891
|
|
|
|
|
53856
|
|
|
42
|
|
|
|
|
132
|
|
|
21
|
|
|
|
|
90
|
|
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
192
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
65
|
|
|
42
|
|
|
|
|
71
|
|
|
42
|
|
|
|
|
110
|
|
|
16888
|
|
|
|
|
84524
|
|
|
26
|
|
|
|
|
102
|
|
|
26
|
|
|
|
|
346
|
|
|
26
|
|
|
|
|
172
|
|
|
10
|
|
|
|
|
26
|
|
|
10
|
|
|
|
|
52
|
|
|
10
|
|
|
|
|
88
|
|
|
7
|
|
|
|
|
32
|
|
6
|
|
|
|
|
|
|
no warnings;my$M=__PACKAGE__.::;*{$M.Object::new}=sub{bless{@_[1..$#_]},$_[0]};*{$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}};$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;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)=@_;$a{default}or return$m;sub{$#_?$m->(@_):!exists$_[0]{$n}?$_[0]{$n}=$a{default}->(@_):$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; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $DumperModule = 'Data::Dumper'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my ($_new_error, $_info, $_scalar_info); |
11
|
2
|
|
|
2
|
|
10
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1876
|
|
12
|
|
|
|
|
|
|
no strict 'refs'; |
13
|
0
|
|
|
0
|
|
|
*{$M.'Object::die'} = sub { |
14
|
0
|
|
|
|
|
|
my $self = shift; |
15
|
0
|
|
|
|
|
|
my $error = $self->$_new_error(@_); |
16
|
0
|
|
|
|
|
|
$error->type('Error'); |
17
|
|
|
|
|
|
|
Carp::croak($error->format_message); |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
|
|
*{$M.'Object::warn'} = sub { |
21
|
0
|
0
|
|
|
|
|
my $self = shift; |
22
|
0
|
|
|
|
|
|
return unless $^W; |
23
|
0
|
|
|
|
|
|
my $error = $self->$_new_error(@_); |
24
|
0
|
|
|
|
|
|
$error->type('Warning'); |
25
|
|
|
|
|
|
|
Carp::cluck($error->format_message); |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# This code needs to be refactored to be simpler and more precise, and no, |
29
|
|
|
|
|
|
|
# Scalar::Util doesn't DWIM. |
30
|
|
|
|
|
|
|
# |
31
|
|
|
|
|
|
|
# Can't handle: |
32
|
|
|
|
|
|
|
# * blessed regexp |
33
|
0
|
|
|
0
|
|
|
*{$M.'Object::node_info'} = sub { |
34
|
0
|
|
0
|
|
|
|
my $self = shift; |
35
|
|
|
|
|
|
|
my $stringify = $_[1] || 0; |
36
|
|
|
|
|
|
|
my ($class, $type, $id) = |
37
|
|
|
|
|
|
|
ref($_[0]) |
38
|
|
|
|
|
|
|
? $stringify |
39
|
0
|
0
|
|
|
|
|
? &$_info("$_[0]") |
|
|
0
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
: do { |
41
|
0
|
|
|
|
|
|
require overload; |
42
|
0
|
0
|
|
|
|
|
my @info = &$_info(overload::StrVal($_[0])); |
43
|
0
|
|
|
|
|
|
if (ref($_[0]) eq 'Regexp') { |
44
|
|
|
|
|
|
|
@info[0, 1] = (undef, 'REGEXP'); |
45
|
0
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
@info; |
47
|
|
|
|
|
|
|
} |
48
|
0
|
0
|
|
|
|
|
: &$_scalar_info($_[0]); |
49
|
|
|
|
|
|
|
($class, $type, $id) = &$_scalar_info("$_[0]") |
50
|
0
|
0
|
|
|
|
|
unless $id; |
51
|
|
|
|
|
|
|
return wantarray ? ($class, $type, $id) : $id; |
52
|
|
|
|
|
|
|
}; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
55
|
|
|
|
|
|
|
$_info = sub { |
56
|
|
|
|
|
|
|
return (($_[0]) =~ qr{^(?:(.*)\=)?([^=]*)\(([^\(]*)\)$}o); |
57
|
|
|
|
|
|
|
}; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$_scalar_info = sub { |
60
|
|
|
|
|
|
|
my $id = 'undef'; |
61
|
|
|
|
|
|
|
if (defined $_[0]) { |
62
|
|
|
|
|
|
|
\$_[0] =~ /\((\w+)\)$/o or CORE::die(); |
63
|
|
|
|
|
|
|
$id = "$1-S"; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
return (undef, undef, $id); |
66
|
|
|
|
|
|
|
}; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
$_new_error = sub { |
69
|
|
|
|
|
|
|
require Carp; |
70
|
|
|
|
|
|
|
my $self = shift; |
71
|
|
|
|
|
|
|
require YAML::Error; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
my $code = shift || 'unknown error'; |
74
|
|
|
|
|
|
|
my $error = YAML::Error->new(code => $code); |
75
|
|
|
|
|
|
|
$error->line($self->line) if $self->can('line'); |
76
|
|
|
|
|
|
|
$error->document($self->document) if $self->can('document'); |
77
|
|
|
|
|
|
|
$error->arguments([@_]); |
78
|
|
|
|
|
|
|
return $error; |
79
|
|
|
|
|
|
|
}; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |