line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::TypeInference::Type::Union; |
2
|
3
|
|
|
3
|
|
1624
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
145
|
|
3
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
587
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
3
|
|
|
3
|
0
|
36
|
my ($class, @types) = @_; |
7
|
3
|
|
|
|
|
22
|
return bless { _types => \@types }, $class; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub name { |
11
|
0
|
|
|
0
|
0
|
0
|
my ($class) = @_; |
12
|
0
|
|
|
|
|
0
|
return 'union'; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub types { |
16
|
3
|
|
|
3
|
0
|
912
|
my ($self) = @_; |
17
|
3
|
|
|
|
|
18
|
return $self->{_types}; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub accepts { |
21
|
7
|
|
|
7
|
0
|
1145
|
my ($class, $data) = @_; |
22
|
7
|
|
|
|
|
24
|
return 0; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub signature { |
26
|
1
|
|
|
1
|
0
|
5
|
my ($self) = @_; |
27
|
1
|
|
|
|
|
2
|
my @signatures = map { $_->signature } @{$self->types}; |
|
2
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
4
|
|
28
|
1
|
|
|
|
|
6
|
return join '|', sort @signatures; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
__END__ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=encoding utf-8 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
JSON::TypeInference::Type::Union - union type |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 DESCRIPTION |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
C< JSON::TypeInference::Type::Union > consists of one or more value types. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
C< JSON::TypeInference::Type::Union > represents a possibility of actual types from inference. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
It is a container type, and has some type parameters. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 AUTHOR |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
aereal E<lt>aereal@aereal.orgE<gt> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|