line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::TypeInference::Type::Number; |
2
|
4
|
|
|
4
|
|
2064
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
99
|
|
3
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
103
|
|
4
|
4
|
|
|
4
|
|
19
|
use parent qw(JSON::TypeInference::Type::Atom); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
19
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
207
|
use Scalar::Util qw(looks_like_number); |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
631
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub name { |
9
|
5
|
|
|
5
|
0
|
11
|
my ($class) = @_; |
10
|
5
|
|
|
|
|
22
|
return 'number'; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub accepts { |
14
|
33
|
|
|
33
|
0
|
1198
|
my ($class, $data) = @_; |
15
|
33
|
|
100
|
|
|
342
|
return !ref($data) && defined($data) && looks_like_number($data); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
1; |
19
|
|
|
|
|
|
|
__END__ |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=encoding utf-8 |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
JSON::TypeInference::Type::Number - JSON number type |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
C< JSON::TypeInference::Type::Number > represents JSON number type. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
It is a value type, and so has no parameters. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 AUTHOR |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
aereal E<lt>aereal@aereal.orgE<gt> |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|