line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::Types::Flexible; |
2
|
5
|
|
|
5
|
|
88326
|
use strict; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
116
|
|
3
|
5
|
|
|
5
|
|
19
|
use warnings; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
102
|
|
4
|
5
|
|
|
5
|
|
17
|
use utf8; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
23
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.03"; |
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
2217
|
use JSON::Types (); |
|
5
|
|
|
|
|
3697
|
|
|
5
|
|
|
|
|
88
|
|
9
|
5
|
|
|
5
|
|
2162
|
use List::MoreUtils qw/uniq/; |
|
5
|
|
|
|
|
34793
|
|
|
5
|
|
|
|
|
40
|
|
10
|
5
|
|
|
5
|
|
4281
|
use Sub::Install; |
|
5
|
|
|
|
|
5892
|
|
|
5
|
|
|
|
|
16
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use constant { |
13
|
5
|
|
|
|
|
570
|
SUB_ALIAS => { |
14
|
|
|
|
|
|
|
number => 'number', |
15
|
|
|
|
|
|
|
string => 'string', |
16
|
|
|
|
|
|
|
bool => 'bool', |
17
|
|
|
|
|
|
|
boolean => 'bool', |
18
|
|
|
|
|
|
|
}, |
19
|
|
|
|
|
|
|
STRICT_SUBS => [qw/ |
20
|
|
|
|
|
|
|
number |
21
|
|
|
|
|
|
|
string |
22
|
|
|
|
|
|
|
boolean |
23
|
|
|
|
|
|
|
/], |
24
|
|
|
|
|
|
|
LOOSE_SUBS => [qw/ |
25
|
|
|
|
|
|
|
bool |
26
|
|
|
|
|
|
|
/], |
27
|
5
|
|
|
5
|
|
231
|
}; |
|
5
|
|
|
|
|
6
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
BEGIN { |
30
|
5
|
|
|
5
|
|
6
|
for (keys %{SUB_ALIAS()}) { |
|
5
|
|
|
|
|
14
|
|
31
|
|
|
|
|
|
|
Sub::Install::install_sub({ |
32
|
20
|
|
|
|
|
714
|
code => SUB_ALIAS->{$_}, |
33
|
|
|
|
|
|
|
from => 'JSON::Types', |
34
|
|
|
|
|
|
|
into => __PACKAGE__, |
35
|
|
|
|
|
|
|
as => $_, |
36
|
|
|
|
|
|
|
}); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub import { |
41
|
4
|
|
|
4
|
|
23
|
my ($pkg, @args) = @_; |
42
|
4
|
|
|
|
|
29
|
my $class = caller; |
43
|
|
|
|
|
|
|
|
44
|
4
|
|
|
|
|
24
|
my @subs; |
45
|
4
|
100
|
66
|
|
|
16
|
if (@args == 0) { |
|
|
100
|
|
|
|
|
|
46
|
2
|
|
|
|
|
2
|
push @subs, @{STRICT_SUBS()}; |
|
2
|
|
|
|
|
4
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
elsif ($args[0] eq ':loose' || $args[0] eq ':all') { |
49
|
1
|
|
|
|
|
1
|
push @subs, @{STRICT_SUBS()}, @{LOOSE_SUBS()}; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
2
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else { |
52
|
1
|
|
|
|
|
2
|
push @subs, @args; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
4
|
|
|
|
|
11
|
for (uniq @subs) { |
56
|
|
|
|
|
|
|
Sub::Install::install_sub({ |
57
|
12
|
|
|
|
|
332
|
code => SUB_ALIAS->{$_}, |
58
|
|
|
|
|
|
|
from => 'JSON::Types', |
59
|
|
|
|
|
|
|
into => $class, |
60
|
|
|
|
|
|
|
as => $_, |
61
|
|
|
|
|
|
|
}); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
__END__ |