line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Type and Constraints Library for Bubblegum |
2
|
|
|
|
|
|
|
package Bubblegum::Constraints; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
14049
|
use 5.10.0; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
7
|
1
|
|
|
1
|
|
407
|
use utf8::all; |
|
1
|
|
|
|
|
37372
|
|
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
2168
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
946
|
use Types::Standard (); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use base 'Exporter::Tiny'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.40'; # VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our @EXPORT_OK; |
17
|
|
|
|
|
|
|
our %EXPORT_TAGS; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $arrayref = Types::Standard->get_type('ArrayRef'); |
20
|
|
|
|
|
|
|
my $boolean = Types::Standard->get_type('Bool'); |
21
|
|
|
|
|
|
|
my $classname = Types::Standard->get_type('ClassName'); |
22
|
|
|
|
|
|
|
my $coderef = Types::Standard->get_type('CodeRef'); |
23
|
|
|
|
|
|
|
my $defined = Types::Standard->get_type('Defined'); |
24
|
|
|
|
|
|
|
my $filehandle = Types::Standard->get_type('FileHandle'); |
25
|
|
|
|
|
|
|
my $globref = Types::Standard->get_type('GlobRef'); |
26
|
|
|
|
|
|
|
my $hashref = Types::Standard->get_type('HashRef'); |
27
|
|
|
|
|
|
|
my $integer = Types::Standard->get_type('Int'); |
28
|
|
|
|
|
|
|
my $number = Types::Standard->get_type('Num'); |
29
|
|
|
|
|
|
|
my $object = Types::Standard->get_type('Object'); |
30
|
|
|
|
|
|
|
my $reference = Types::Standard->get_type('Ref'); |
31
|
|
|
|
|
|
|
my $regexpref = Types::Standard->get_type('RegexpRef'); |
32
|
|
|
|
|
|
|
my $scalarref = Types::Standard->get_type('ScalarRef'); |
33
|
|
|
|
|
|
|
my $string = Types::Standard->get_type('Str'); |
34
|
|
|
|
|
|
|
my $undefined = Types::Standard->get_type('Undef'); |
35
|
|
|
|
|
|
|
my $value = Types::Standard->get_type('Value'); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
no warnings 'once'; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# EXPORT: ISAS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_aref'; |
42
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_aref'; |
43
|
|
|
|
|
|
|
*isa_aref = $arrayref->compiled_check; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_arrayref'; |
46
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_arrayref'; |
47
|
|
|
|
|
|
|
*isa_arrayref = $arrayref->compiled_check; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_bool'; |
50
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_bool'; |
51
|
|
|
|
|
|
|
*isa_bool = $boolean->compiled_check; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_boolean'; |
54
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_boolean'; |
55
|
|
|
|
|
|
|
*isa_boolean = $boolean->compiled_check; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_class'; |
58
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_class'; |
59
|
|
|
|
|
|
|
*isa_class = $classname->compiled_check; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_classname'; |
62
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_classname'; |
63
|
|
|
|
|
|
|
*isa_classname = $classname->compiled_check; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_coderef'; |
66
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_coderef'; |
67
|
|
|
|
|
|
|
*isa_coderef = $coderef->compiled_check; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_cref'; |
70
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_cref'; |
71
|
|
|
|
|
|
|
*isa_cref = $coderef->compiled_check; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_def'; |
74
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_def'; |
75
|
|
|
|
|
|
|
*isa_def = $defined->compiled_check; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_defined'; |
78
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_defined'; |
79
|
|
|
|
|
|
|
*isa_defined = $defined->compiled_check; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_fh'; |
82
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_fh'; |
83
|
|
|
|
|
|
|
*isa_fh = $filehandle->compiled_check; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_filehandle'; |
86
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_filehandle'; |
87
|
|
|
|
|
|
|
*isa_filehandle = $filehandle->compiled_check; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_glob'; |
90
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_glob'; |
91
|
|
|
|
|
|
|
*isa_glob = $globref->compiled_check; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_globref'; |
94
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_globref'; |
95
|
|
|
|
|
|
|
*isa_globref = $globref->compiled_check; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_hashref'; |
98
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_hashref'; |
99
|
|
|
|
|
|
|
*isa_hashref = $hashref->compiled_check; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_href'; |
102
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_href'; |
103
|
|
|
|
|
|
|
*isa_href = $hashref->compiled_check; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_int'; |
106
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_int'; |
107
|
|
|
|
|
|
|
*isa_int = $integer->compiled_check; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_integer'; |
110
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_integer'; |
111
|
|
|
|
|
|
|
*isa_integer = $integer->compiled_check; |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_num'; |
114
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_num'; |
115
|
|
|
|
|
|
|
*isa_num = $number->compiled_check; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_number'; |
118
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_number'; |
119
|
|
|
|
|
|
|
*isa_number = $number->compiled_check; |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_obj'; |
122
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_obj'; |
123
|
|
|
|
|
|
|
*isa_obj = $object->compiled_check; |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_object'; |
126
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_object'; |
127
|
|
|
|
|
|
|
*isa_object = $object->compiled_check; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_ref'; |
130
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_ref'; |
131
|
|
|
|
|
|
|
*isa_ref = $reference->compiled_check; |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_reference'; |
134
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_reference'; |
135
|
|
|
|
|
|
|
*isa_reference = $reference->compiled_check; |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_regexpref'; |
138
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_regexpref'; |
139
|
|
|
|
|
|
|
*isa_regexpref = $regexpref->compiled_check; |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_rref'; |
142
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_rref'; |
143
|
|
|
|
|
|
|
*isa_rref = $regexpref->compiled_check; |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_scalarref'; |
146
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_scalarref'; |
147
|
|
|
|
|
|
|
*isa_scalarref = $scalarref->compiled_check; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_sref'; |
150
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_sref'; |
151
|
|
|
|
|
|
|
*isa_sref = $scalarref->compiled_check; |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_str'; |
154
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_str'; |
155
|
|
|
|
|
|
|
*isa_str = $string->compiled_check; |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_string'; |
158
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_string'; |
159
|
|
|
|
|
|
|
*isa_string = $string->compiled_check; |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_nil'; |
162
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_nil'; |
163
|
|
|
|
|
|
|
*isa_nil = $undefined->compiled_check; |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_null'; |
166
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_null'; |
167
|
|
|
|
|
|
|
*isa_null = $undefined->compiled_check; |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_undef'; |
170
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_undef'; |
171
|
|
|
|
|
|
|
*isa_undef = $undefined->compiled_check; |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_undefined'; |
174
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_undefined'; |
175
|
|
|
|
|
|
|
*isa_undefined = $undefined->compiled_check; |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_val'; |
178
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_val'; |
179
|
|
|
|
|
|
|
*isa_val = $value->compiled_check; |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
push @EXPORT_OK, 'isa_value'; |
182
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{isas}}, 'isa_value'; |
183
|
|
|
|
|
|
|
*isa_value = $value->compiled_check; |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
# EXPORT: NOTS |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_aref'; |
188
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_aref'; |
189
|
|
|
|
|
|
|
*not_aref = $arrayref->complementary_type->compiled_check; |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_arrayref'; |
192
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_arrayref'; |
193
|
|
|
|
|
|
|
*not_arrayref = $arrayref->complementary_type->compiled_check; |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_bool'; |
196
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_bool'; |
197
|
|
|
|
|
|
|
*not_bool = $boolean->complementary_type->compiled_check; |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_boolean'; |
200
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_boolean'; |
201
|
|
|
|
|
|
|
*not_boolean = $boolean->complementary_type->compiled_check; |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_class'; |
204
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_class'; |
205
|
|
|
|
|
|
|
*not_class = $classname->complementary_type->compiled_check; |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_classname'; |
208
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_classname'; |
209
|
|
|
|
|
|
|
*not_classname = $classname->complementary_type->compiled_check; |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_coderef'; |
212
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_coderef'; |
213
|
|
|
|
|
|
|
*not_coderef = $coderef->complementary_type->compiled_check; |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_cref'; |
216
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_cref'; |
217
|
|
|
|
|
|
|
*not_cref = $coderef->complementary_type->compiled_check; |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_def'; |
220
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_def'; |
221
|
|
|
|
|
|
|
*not_def = $defined->complementary_type->compiled_check; |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_defined'; |
224
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_defined'; |
225
|
|
|
|
|
|
|
*not_defined = $defined->complementary_type->compiled_check; |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_fh'; |
228
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_fh'; |
229
|
|
|
|
|
|
|
*not_fh = $filehandle->complementary_type->compiled_check; |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_filehandle'; |
232
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_filehandle'; |
233
|
|
|
|
|
|
|
*not_filehandle = $filehandle->complementary_type->compiled_check; |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_glob'; |
236
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_glob'; |
237
|
|
|
|
|
|
|
*not_glob = $globref->complementary_type->compiled_check; |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_globref'; |
240
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_globref'; |
241
|
|
|
|
|
|
|
*not_globref = $globref->complementary_type->compiled_check; |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_hashref'; |
244
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_hashref'; |
245
|
|
|
|
|
|
|
*not_hashref = $hashref->complementary_type->compiled_check; |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_href'; |
248
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_href'; |
249
|
|
|
|
|
|
|
*not_href = $hashref->complementary_type->compiled_check; |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_int'; |
252
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_int'; |
253
|
|
|
|
|
|
|
*not_int = $integer->complementary_type->compiled_check; |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_integer'; |
256
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_integer'; |
257
|
|
|
|
|
|
|
*not_integer = $integer->complementary_type->compiled_check; |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_num'; |
260
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_num'; |
261
|
|
|
|
|
|
|
*not_num = $number->complementary_type->compiled_check; |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_number'; |
264
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_number'; |
265
|
|
|
|
|
|
|
*not_number = $number->complementary_type->compiled_check; |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_obj'; |
268
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_obj'; |
269
|
|
|
|
|
|
|
*not_obj = $object->complementary_type->compiled_check; |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_object'; |
272
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_object'; |
273
|
|
|
|
|
|
|
*not_object = $object->complementary_type->compiled_check; |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_ref'; |
276
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_ref'; |
277
|
|
|
|
|
|
|
*not_ref = $reference->complementary_type->compiled_check; |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_reference'; |
280
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_reference'; |
281
|
|
|
|
|
|
|
*not_reference = $reference->complementary_type->compiled_check; |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_regexpref'; |
284
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_regexpref'; |
285
|
|
|
|
|
|
|
*not_regexpref = $regexpref->complementary_type->compiled_check; |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_rref'; |
288
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_rref'; |
289
|
|
|
|
|
|
|
*not_rref = $regexpref->complementary_type->compiled_check; |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_scalarref'; |
292
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_scalarref'; |
293
|
|
|
|
|
|
|
*not_scalarref = $scalarref->complementary_type->compiled_check; |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_sref'; |
296
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_sref'; |
297
|
|
|
|
|
|
|
*not_sref = $scalarref->complementary_type->compiled_check; |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_str'; |
300
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_str'; |
301
|
|
|
|
|
|
|
*not_str = $string->complementary_type->compiled_check; |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_string'; |
304
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_string'; |
305
|
|
|
|
|
|
|
*not_string = $string->complementary_type->compiled_check; |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_nil'; |
308
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_nil'; |
309
|
|
|
|
|
|
|
*not_nil = $undefined->complementary_type->compiled_check; |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_null'; |
312
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_null'; |
313
|
|
|
|
|
|
|
*not_null = $undefined->complementary_type->compiled_check; |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_undef'; |
316
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_undef'; |
317
|
|
|
|
|
|
|
*not_undef = $undefined->complementary_type->compiled_check; |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_undefined'; |
320
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_undefined'; |
321
|
|
|
|
|
|
|
*not_undefined = $undefined->complementary_type->compiled_check; |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_val'; |
324
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_val'; |
325
|
|
|
|
|
|
|
*not_val = $value->complementary_type->compiled_check; |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
push @EXPORT_OK, 'not_value'; |
328
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{nots}}, 'not_value'; |
329
|
|
|
|
|
|
|
*not_value = $value->complementary_type->compiled_check; |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
# EXPORT: TYPES |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_aref'; |
334
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_aref'; |
335
|
|
|
|
|
|
|
*type_aref = $arrayref->_overload_coderef; |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_arrayref'; |
338
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_arrayref'; |
339
|
|
|
|
|
|
|
*type_arrayref = $arrayref->_overload_coderef; |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_bool'; |
342
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_bool'; |
343
|
|
|
|
|
|
|
*type_bool = $boolean->_overload_coderef; |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_boolean'; |
346
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_boolean'; |
347
|
|
|
|
|
|
|
*type_boolean = $boolean->_overload_coderef; |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_class'; |
350
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_class'; |
351
|
|
|
|
|
|
|
*type_class = $classname->_overload_coderef; |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_classname'; |
354
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_classname'; |
355
|
|
|
|
|
|
|
*type_classname = $classname->_overload_coderef; |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_coderef'; |
358
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_coderef'; |
359
|
|
|
|
|
|
|
*type_coderef = $coderef->_overload_coderef; |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_cref'; |
362
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_cref'; |
363
|
|
|
|
|
|
|
*type_cref = $coderef->_overload_coderef; |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_def'; |
366
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_def'; |
367
|
|
|
|
|
|
|
*type_def = $defined->_overload_coderef; |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_defined'; |
370
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_defined'; |
371
|
|
|
|
|
|
|
*type_defined = $defined->_overload_coderef; |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_fh'; |
374
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_fh'; |
375
|
|
|
|
|
|
|
*type_fh = $filehandle->_overload_coderef; |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_filehandle'; |
378
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_filehandle'; |
379
|
|
|
|
|
|
|
*type_filehandle = $filehandle->_overload_coderef; |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_glob'; |
382
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_glob'; |
383
|
|
|
|
|
|
|
*type_glob = $globref->_overload_coderef; |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_globref'; |
386
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_globref'; |
387
|
|
|
|
|
|
|
*type_globref = $globref->_overload_coderef; |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_hashref'; |
390
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_hashref'; |
391
|
|
|
|
|
|
|
*type_hashref = $hashref->_overload_coderef; |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_href'; |
394
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_href'; |
395
|
|
|
|
|
|
|
*type_href = $hashref->_overload_coderef; |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_int'; |
398
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_int'; |
399
|
|
|
|
|
|
|
*type_int = $integer->_overload_coderef; |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_integer'; |
402
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_integer'; |
403
|
|
|
|
|
|
|
*type_integer = $integer->_overload_coderef; |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_num'; |
406
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_num'; |
407
|
|
|
|
|
|
|
*type_num = $number->_overload_coderef; |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_number'; |
410
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_number'; |
411
|
|
|
|
|
|
|
*type_number = $number->_overload_coderef; |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_obj'; |
414
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_obj'; |
415
|
|
|
|
|
|
|
*type_obj = $object->_overload_coderef; |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_object'; |
418
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_object'; |
419
|
|
|
|
|
|
|
*type_object = $object->_overload_coderef; |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_ref'; |
422
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_ref'; |
423
|
|
|
|
|
|
|
*type_ref = $reference->_overload_coderef; |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_reference'; |
426
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_reference'; |
427
|
|
|
|
|
|
|
*type_reference = $reference->_overload_coderef; |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_regexpref'; |
430
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_regexpref'; |
431
|
|
|
|
|
|
|
*type_regexpref = $regexpref->_overload_coderef; |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_rref'; |
434
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_rref'; |
435
|
|
|
|
|
|
|
*type_rref = $regexpref->_overload_coderef; |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_scalarref'; |
438
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_scalarref'; |
439
|
|
|
|
|
|
|
*type_scalarref = $scalarref->_overload_coderef; |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_sref'; |
442
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_sref'; |
443
|
|
|
|
|
|
|
*type_sref = $scalarref->_overload_coderef; |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_str'; |
446
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_str'; |
447
|
|
|
|
|
|
|
*type_str = $string->_overload_coderef; |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_string'; |
450
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_string'; |
451
|
|
|
|
|
|
|
*type_string = $string->_overload_coderef; |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_nil'; |
454
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_nil'; |
455
|
|
|
|
|
|
|
*type_nil = $undefined->_overload_coderef; |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_null'; |
458
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_null'; |
459
|
|
|
|
|
|
|
*type_null = $undefined->_overload_coderef; |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_undef'; |
462
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_undef'; |
463
|
|
|
|
|
|
|
*type_undef = $undefined->_overload_coderef; |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_undefined'; |
466
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_undefined'; |
467
|
|
|
|
|
|
|
*type_undefined = $undefined->_overload_coderef; |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_val'; |
470
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_val'; |
471
|
|
|
|
|
|
|
*type_val = $value->_overload_coderef; |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
push @EXPORT_OK, 'type_value'; |
474
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{types}}, 'type_value'; |
475
|
|
|
|
|
|
|
*type_value = $value->_overload_coderef; |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
# EXPORT: TYPESOF |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_aref'; |
480
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_aref'; |
481
|
|
|
|
|
|
|
*typeof_aref = sub () { |
482
|
|
|
|
|
|
|
require Type::Params; |
483
|
|
|
|
|
|
|
Type::Params::compile($arrayref); |
484
|
|
|
|
|
|
|
}; |
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_arrayref'; |
487
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_arrayref'; |
488
|
|
|
|
|
|
|
*typeof_arrayref = sub () { |
489
|
|
|
|
|
|
|
require Type::Params; |
490
|
|
|
|
|
|
|
Type::Params::compile($arrayref); |
491
|
|
|
|
|
|
|
}; |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_bool'; |
494
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_bool'; |
495
|
|
|
|
|
|
|
*typeof_bool = sub () { |
496
|
|
|
|
|
|
|
require Type::Params; |
497
|
|
|
|
|
|
|
Type::Params::compile($boolean); |
498
|
|
|
|
|
|
|
}; |
499
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_boolean'; |
501
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_boolean'; |
502
|
|
|
|
|
|
|
*typeof_boolean = sub () { |
503
|
|
|
|
|
|
|
require Type::Params; |
504
|
|
|
|
|
|
|
Type::Params::compile($boolean); |
505
|
|
|
|
|
|
|
}; |
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_class'; |
508
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_class'; |
509
|
|
|
|
|
|
|
*typeof_class = sub () { |
510
|
|
|
|
|
|
|
require Type::Params; |
511
|
|
|
|
|
|
|
Type::Params::compile($classname); |
512
|
|
|
|
|
|
|
}; |
513
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_classname'; |
515
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_classname'; |
516
|
|
|
|
|
|
|
*typeof_classname = sub () { |
517
|
|
|
|
|
|
|
require Type::Params; |
518
|
|
|
|
|
|
|
Type::Params::compile($classname); |
519
|
|
|
|
|
|
|
}; |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_coderef'; |
522
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_coderef'; |
523
|
|
|
|
|
|
|
*typeof_coderef = sub () { |
524
|
|
|
|
|
|
|
require Type::Params; |
525
|
|
|
|
|
|
|
Type::Params::compile($coderef); |
526
|
|
|
|
|
|
|
}; |
527
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_cref'; |
529
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_cref'; |
530
|
|
|
|
|
|
|
*typeof_cref = sub () { |
531
|
|
|
|
|
|
|
require Type::Params; |
532
|
|
|
|
|
|
|
Type::Params::compile($coderef); |
533
|
|
|
|
|
|
|
}; |
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_def'; |
536
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_def'; |
537
|
|
|
|
|
|
|
*typeof_def = sub () { |
538
|
|
|
|
|
|
|
require Type::Params; |
539
|
|
|
|
|
|
|
Type::Params::compile($defined); |
540
|
|
|
|
|
|
|
}; |
541
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_defined'; |
543
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_defined'; |
544
|
|
|
|
|
|
|
*typeof_defined = sub () { |
545
|
|
|
|
|
|
|
require Type::Params; |
546
|
|
|
|
|
|
|
Type::Params::compile($defined); |
547
|
|
|
|
|
|
|
}; |
548
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_fh'; |
550
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_fh'; |
551
|
|
|
|
|
|
|
*typeof_fh = sub () { |
552
|
|
|
|
|
|
|
require Type::Params; |
553
|
|
|
|
|
|
|
Type::Params::compile($filehandle); |
554
|
|
|
|
|
|
|
}; |
555
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_filehandle'; |
557
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_filehandle'; |
558
|
|
|
|
|
|
|
*typeof_filehandle = sub () { |
559
|
|
|
|
|
|
|
require Type::Params; |
560
|
|
|
|
|
|
|
Type::Params::compile($filehandle); |
561
|
|
|
|
|
|
|
}; |
562
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_glob'; |
564
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_glob'; |
565
|
|
|
|
|
|
|
*typeof_glob = sub () { |
566
|
|
|
|
|
|
|
require Type::Params; |
567
|
|
|
|
|
|
|
Type::Params::compile($globref); |
568
|
|
|
|
|
|
|
}; |
569
|
|
|
|
|
|
|
|
570
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_globref'; |
571
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_globref'; |
572
|
|
|
|
|
|
|
*typeof_globref = sub () { |
573
|
|
|
|
|
|
|
require Type::Params; |
574
|
|
|
|
|
|
|
Type::Params::compile($globref); |
575
|
|
|
|
|
|
|
}; |
576
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_hashref'; |
578
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_hashref'; |
579
|
|
|
|
|
|
|
*typeof_hashref = sub () { |
580
|
|
|
|
|
|
|
require Type::Params; |
581
|
|
|
|
|
|
|
Type::Params::compile($hashref); |
582
|
|
|
|
|
|
|
}; |
583
|
|
|
|
|
|
|
|
584
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_href'; |
585
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_href'; |
586
|
|
|
|
|
|
|
*typeof_href = sub () { |
587
|
|
|
|
|
|
|
require Type::Params; |
588
|
|
|
|
|
|
|
Type::Params::compile($hashref); |
589
|
|
|
|
|
|
|
}; |
590
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_int'; |
592
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_int'; |
593
|
|
|
|
|
|
|
*typeof_int = sub () { |
594
|
|
|
|
|
|
|
require Type::Params; |
595
|
|
|
|
|
|
|
Type::Params::compile($integer); |
596
|
|
|
|
|
|
|
}; |
597
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_integer'; |
599
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_integer'; |
600
|
|
|
|
|
|
|
*typeof_integer = sub () { |
601
|
|
|
|
|
|
|
require Type::Params; |
602
|
|
|
|
|
|
|
Type::Params::compile($integer); |
603
|
|
|
|
|
|
|
}; |
604
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_num'; |
606
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_num'; |
607
|
|
|
|
|
|
|
*typeof_num = sub () { |
608
|
|
|
|
|
|
|
require Type::Params; |
609
|
|
|
|
|
|
|
Type::Params::compile($number); |
610
|
|
|
|
|
|
|
}; |
611
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_number'; |
613
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_number'; |
614
|
|
|
|
|
|
|
*typeof_number = sub () { |
615
|
|
|
|
|
|
|
require Type::Params; |
616
|
|
|
|
|
|
|
Type::Params::compile($number); |
617
|
|
|
|
|
|
|
}; |
618
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_obj'; |
620
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_obj'; |
621
|
|
|
|
|
|
|
*typeof_obj = sub () { |
622
|
|
|
|
|
|
|
require Type::Params; |
623
|
|
|
|
|
|
|
Type::Params::compile($object); |
624
|
|
|
|
|
|
|
}; |
625
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_object'; |
627
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_object'; |
628
|
|
|
|
|
|
|
*typeof_object = sub () { |
629
|
|
|
|
|
|
|
require Type::Params; |
630
|
|
|
|
|
|
|
Type::Params::compile($object); |
631
|
|
|
|
|
|
|
}; |
632
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_ref'; |
634
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_ref'; |
635
|
|
|
|
|
|
|
*typeof_ref = sub () { |
636
|
|
|
|
|
|
|
require Type::Params; |
637
|
|
|
|
|
|
|
Type::Params::compile($reference); |
638
|
|
|
|
|
|
|
}; |
639
|
|
|
|
|
|
|
|
640
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_reference'; |
641
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_reference'; |
642
|
|
|
|
|
|
|
*typeof_reference = sub () { |
643
|
|
|
|
|
|
|
require Type::Params; |
644
|
|
|
|
|
|
|
Type::Params::compile($reference); |
645
|
|
|
|
|
|
|
}; |
646
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_regexpref'; |
648
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_regexpref'; |
649
|
|
|
|
|
|
|
*typeof_regexpref = sub () { |
650
|
|
|
|
|
|
|
require Type::Params; |
651
|
|
|
|
|
|
|
Type::Params::compile($regexpref); |
652
|
|
|
|
|
|
|
}; |
653
|
|
|
|
|
|
|
|
654
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_rref'; |
655
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_rref'; |
656
|
|
|
|
|
|
|
*typeof_rref = sub () { |
657
|
|
|
|
|
|
|
require Type::Params; |
658
|
|
|
|
|
|
|
Type::Params::compile($regexpref); |
659
|
|
|
|
|
|
|
}; |
660
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_scalarref'; |
662
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_scalarref'; |
663
|
|
|
|
|
|
|
*typeof_scalarref = sub () { |
664
|
|
|
|
|
|
|
require Type::Params; |
665
|
|
|
|
|
|
|
Type::Params::compile($scalarref); |
666
|
|
|
|
|
|
|
}; |
667
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_sref'; |
669
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_sref'; |
670
|
|
|
|
|
|
|
*typeof_sref = sub () { |
671
|
|
|
|
|
|
|
require Type::Params; |
672
|
|
|
|
|
|
|
Type::Params::compile($scalarref); |
673
|
|
|
|
|
|
|
}; |
674
|
|
|
|
|
|
|
|
675
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_str'; |
676
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_str'; |
677
|
|
|
|
|
|
|
*typeof_str = sub () { |
678
|
|
|
|
|
|
|
require Type::Params; |
679
|
|
|
|
|
|
|
Type::Params::compile($string); |
680
|
|
|
|
|
|
|
}; |
681
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_string'; |
683
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_string'; |
684
|
|
|
|
|
|
|
*typeof_string = sub () { |
685
|
|
|
|
|
|
|
require Type::Params; |
686
|
|
|
|
|
|
|
Type::Params::compile($string); |
687
|
|
|
|
|
|
|
}; |
688
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_nil'; |
690
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_nil'; |
691
|
|
|
|
|
|
|
*typeof_nil = sub () { |
692
|
|
|
|
|
|
|
require Type::Params; |
693
|
|
|
|
|
|
|
Type::Params::compile($undefined); |
694
|
|
|
|
|
|
|
}; |
695
|
|
|
|
|
|
|
|
696
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_null'; |
697
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_null'; |
698
|
|
|
|
|
|
|
*typeof_null = sub () { |
699
|
|
|
|
|
|
|
require Type::Params; |
700
|
|
|
|
|
|
|
Type::Params::compile($undefined); |
701
|
|
|
|
|
|
|
}; |
702
|
|
|
|
|
|
|
|
703
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_undef'; |
704
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_undef'; |
705
|
|
|
|
|
|
|
*typeof_undef = sub () { |
706
|
|
|
|
|
|
|
require Type::Params; |
707
|
|
|
|
|
|
|
Type::Params::compile($undefined); |
708
|
|
|
|
|
|
|
}; |
709
|
|
|
|
|
|
|
|
710
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_undefined'; |
711
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_undefined'; |
712
|
|
|
|
|
|
|
*typeof_undefined = sub () { |
713
|
|
|
|
|
|
|
require Type::Params; |
714
|
|
|
|
|
|
|
Type::Params::compile($undefined); |
715
|
|
|
|
|
|
|
}; |
716
|
|
|
|
|
|
|
|
717
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_val'; |
718
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_val'; |
719
|
|
|
|
|
|
|
*typeof_val = sub () { |
720
|
|
|
|
|
|
|
require Type::Params; |
721
|
|
|
|
|
|
|
Type::Params::compile($value); |
722
|
|
|
|
|
|
|
}; |
723
|
|
|
|
|
|
|
|
724
|
|
|
|
|
|
|
push @EXPORT_OK, 'typeof_value'; |
725
|
|
|
|
|
|
|
push @{$EXPORT_TAGS{typesof}}, 'typeof_value'; |
726
|
|
|
|
|
|
|
*typeof_value = sub () { |
727
|
|
|
|
|
|
|
require Type::Params; |
728
|
|
|
|
|
|
|
Type::Params::compile($value); |
729
|
|
|
|
|
|
|
}; |
730
|
|
|
|
|
|
|
|
731
|
|
|
|
|
|
|
1; |
732
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
__END__ |