line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::TypeInference::Type::Number; |
2
|
4
|
|
|
4
|
|
2283
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
102
|
|
3
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
102
|
|
4
|
4
|
|
|
4
|
|
18
|
use parent qw(JSON::TypeInference::Type::Atom); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
19
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
208
|
use Scalar::Util qw(looks_like_number); |
|
4
|
|
|
|
|
21
|
|
|
4
|
|
|
|
|
659
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub name { |
9
|
5
|
|
|
5
|
0
|
10
|
my ($class) = @_; |
10
|
5
|
|
|
|
|
19
|
return 'number'; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub accepts { |
14
|
33
|
|
|
33
|
0
|
1608
|
my ($class, $data) = @_; |
15
|
33
|
|
100
|
|
|
332
|
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
|
|
|
|
|
|
|
|