line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::Types::Flexible; |
2
|
5
|
|
|
5
|
|
117864
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
168
|
|
3
|
5
|
|
|
5
|
|
24
|
use warnings; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
160
|
|
4
|
5
|
|
|
5
|
|
22
|
use utf8; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
33
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.02"; |
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
2942
|
use JSON::Types (); |
|
5
|
|
|
|
|
5376
|
|
|
5
|
|
|
|
|
130
|
|
9
|
5
|
|
|
5
|
|
3130
|
use List::MoreUtils qw/uniq/; |
|
5
|
|
|
|
|
51912
|
|
|
5
|
|
|
|
|
39
|
|
10
|
5
|
|
|
5
|
|
6457
|
use Sub::Install; |
|
5
|
|
|
|
|
10133
|
|
|
5
|
|
|
|
|
25
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use constant { |
13
|
5
|
|
|
|
|
750
|
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
|
|
313
|
}; |
|
5
|
|
|
|
|
8
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
BEGIN { |
30
|
5
|
|
|
5
|
|
11
|
for (keys %{SUB_ALIAS()}) { |
|
5
|
|
|
|
|
20
|
|
31
|
|
|
|
|
|
|
Sub::Install::install_sub({ |
32
|
20
|
|
|
|
|
1057
|
code => SUB_ALIAS->{$_}, |
33
|
|
|
|
|
|
|
from => 'JSON::Types', |
34
|
|
|
|
|
|
|
into => __PACKAGE__, |
35
|
|
|
|
|
|
|
as => $_, |
36
|
|
|
|
|
|
|
}); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub import { |
41
|
4
|
|
|
4
|
|
36
|
my ($pkg, @args) = @_; |
42
|
4
|
|
|
|
|
37
|
my $class = caller; |
43
|
|
|
|
|
|
|
|
44
|
4
|
|
|
|
|
30
|
my @subs; |
45
|
4
|
100
|
66
|
|
|
25
|
if (@args == 0) { |
|
|
100
|
|
|
|
|
|
46
|
2
|
|
|
|
|
2
|
push @subs, @{STRICT_SUBS()}; |
|
2
|
|
|
|
|
5
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
elsif ($args[0] eq ':loose' || $args[0] eq ':all') { |
49
|
1
|
|
|
|
|
1
|
push @subs, @{STRICT_SUBS()}, @{LOOSE_SUBS()}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else { |
52
|
1
|
|
|
|
|
2
|
push @subs, @args; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
4
|
|
|
|
|
80
|
for (uniq @subs) { |
56
|
|
|
|
|
|
|
Sub::Install::install_sub({ |
57
|
12
|
|
|
|
|
437
|
code => SUB_ALIAS->{$_}, |
58
|
|
|
|
|
|
|
from => 'JSON::Types', |
59
|
|
|
|
|
|
|
into => $class, |
60
|
|
|
|
|
|
|
as => $_, |
61
|
|
|
|
|
|
|
}); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
__END__ |