line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::TypeInference::Type::Union; |
2
|
3
|
|
|
3
|
|
1675
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
71
|
|
3
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
582
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
3
|
|
|
3
|
0
|
39
|
my ($class, @types) = @_; |
7
|
3
|
|
|
|
|
24
|
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
|
942
|
my ($self) = @_; |
17
|
3
|
|
|
|
|
16
|
return $self->{_types}; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub accepts { |
21
|
7
|
|
|
7
|
0
|
1556
|
my ($class, $data) = @_; |
22
|
7
|
|
|
|
|
28
|
return 0; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub signature { |
26
|
1
|
|
|
1
|
0
|
5
|
my ($self) = @_; |
27
|
1
|
|
|
|
|
3
|
my @signatures = map { $_->signature } @{$self->types}; |
|
2
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
4
|
|
28
|
1
|
|
|
|
|
8
|
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
|
|
|
|
|
|
|
|