line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::TypeCheck::Type::TTerm; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
86
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Devel::TypeCheck::Type::TTerm - Generic terminal types. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 SYNOPSIS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use Devel::TypeCheck::Type::TTerm; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
@ISA = (... Devel::TypeCheck::Type::TTerm ...); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
This abstract type overrides methods from Type to support terminal |
19
|
|
|
|
|
|
|
types. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Inherits from Devel::TypeCheck::Type::Type. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
our @ISA = qw(Devel::TypeCheck::Type); |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
7
|
use Devel::TypeCheck::Type qw(n2s); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
52
|
|
27
|
1
|
|
|
1
|
|
7
|
use Devel::TypeCheck::Util; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
550
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# **** INSTANCE **** |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub new { |
32
|
0
|
|
|
0
|
1
|
|
my ($name) = @_; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
my $this = {}; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
bless($this, $name); |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return $this; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub unify { |
43
|
0
|
|
|
0
|
0
|
|
my ($this, $that, $env) = @_; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
$this = $env->find($this); |
46
|
0
|
|
|
|
|
|
$that = $env->find($that); |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
if ($this->type == $that->type) { |
49
|
0
|
|
|
|
|
|
return $this->type; |
50
|
|
|
|
|
|
|
} else { |
51
|
0
|
|
|
|
|
|
return undef; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub occurs { |
56
|
0
|
|
|
0
|
0
|
|
my ($this, $that, $env) = @_; |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return FALSE; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub type { |
62
|
0
|
|
|
0
|
1
|
|
croak("Method &type not implemented for abstract class Devel::TypeCheck::Type::TVar"); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub subtype { |
66
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
67
|
0
|
|
|
|
|
|
confess("Method &subtype is abstract in class " . ref($this)); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub str { |
71
|
0
|
|
|
0
|
1
|
|
my ($this, $env) = @_; |
72
|
0
|
|
|
|
|
|
return ("<" . Devel::TypeCheck::Type::n2s($this->type) . ">"); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub deref { |
76
|
0
|
|
|
0
|
1
|
|
return undef; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub is { |
80
|
0
|
|
|
0
|
1
|
|
my ($this, $type) = @_; |
81
|
0
|
0
|
|
|
|
|
if ($this->type == $type) { |
82
|
0
|
|
|
|
|
|
return TRUE; |
83
|
|
|
|
|
|
|
} else { |
84
|
0
|
|
|
|
|
|
return FALSE; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub complete { |
89
|
0
|
|
|
0
|
1
|
|
return TRUE; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
TRUE; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 AUTHOR |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Gary Jackson, C<< >> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 BUGS |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This version is specific to Perl 5.8.1. It may work with other |
101
|
|
|
|
|
|
|
versions that have the same opcode list and structure, but this is |
102
|
|
|
|
|
|
|
entirely untested. It definitely will not work if those parameters |
103
|
|
|
|
|
|
|
change. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
106
|
|
|
|
|
|
|
C, or through the web interface at |
107
|
|
|
|
|
|
|
L. |
108
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
109
|
|
|
|
|
|
|
your bug as I make changes. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Copyright 2005 Gary Jackson, all rights reserved. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
116
|
|
|
|
|
|
|
under the same terms as Perl itself. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=cut |