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