| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
9
|
|
|
9
|
|
127
|
use 5.008001; |
|
|
9
|
|
|
|
|
25
|
|
|
2
|
9
|
|
|
9
|
|
73
|
use strict; |
|
|
9
|
|
|
|
|
14
|
|
|
|
9
|
|
|
|
|
187
|
|
|
3
|
9
|
|
|
9
|
|
129
|
use warnings; |
|
|
9
|
|
|
|
|
19
|
|
|
|
9
|
|
|
|
|
315
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Types; |
|
6
|
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
45
|
use Exporter (); |
|
|
9
|
|
|
|
|
27
|
|
|
|
9
|
|
|
|
|
210
|
|
|
8
|
9
|
|
|
9
|
|
39
|
use Carp qw( croak ); |
|
|
9
|
|
|
|
|
48
|
|
|
|
9
|
|
|
|
|
1748
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @ISA = qw( Exporter ); |
|
11
|
|
|
|
|
|
|
our @EXPORT; |
|
12
|
|
|
|
|
|
|
our @EXPORT_OK; |
|
13
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
|
14
|
|
|
|
|
|
|
is => [], |
|
15
|
|
|
|
|
|
|
types => [], |
|
16
|
|
|
|
|
|
|
assert => [], |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
0
|
BEGIN { |
|
20
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Types::TypeConstraint; |
|
21
|
9
|
|
|
9
|
|
10812
|
our $LIBRARY = "Acme::Mitey::Cards::Types"; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use overload ( |
|
24
|
|
|
|
|
|
|
fallback => !!1, |
|
25
|
|
|
|
|
|
|
'|' => 'union', |
|
26
|
85
|
|
|
85
|
|
460
|
bool => sub { !! 1 }, |
|
27
|
0
|
|
|
0
|
|
0
|
'""' => sub { shift->[1] }, |
|
28
|
|
|
|
|
|
|
'&{}' => sub { |
|
29
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
|
30
|
0
|
|
|
0
|
|
0
|
return sub { $self->assert_return( @_ ) }; |
|
|
0
|
|
|
|
|
0
|
|
|
31
|
|
|
|
|
|
|
}, |
|
32
|
9
|
|
|
9
|
|
2026
|
); |
|
|
9
|
|
|
|
|
1669
|
|
|
|
9
|
|
|
|
|
100
|
|
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub union { |
|
35
|
3
|
|
|
3
|
|
18
|
my @types = grep ref( $_ ), @_; |
|
36
|
3
|
|
|
|
|
16
|
my @codes = map $_->[0], @types; |
|
37
|
|
|
|
|
|
|
bless [ |
|
38
|
0
|
0
|
|
0
|
|
0
|
sub { for ( @codes ) { return 1 if $_->(@_) } return 0 }, |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
39
|
3
|
|
|
|
|
68
|
join( '|', map $_->[1], @types ), |
|
40
|
|
|
|
|
|
|
\@types, |
|
41
|
|
|
|
|
|
|
], __PACKAGE__; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub check { |
|
45
|
0
|
|
|
0
|
|
0
|
$_[0][0]->( $_[1] ); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub get_message { |
|
49
|
0
|
0
|
|
0
|
|
0
|
sprintf '%s did not pass type constraint "%s"', |
|
50
|
|
|
|
|
|
|
defined( $_[1] ) ? $_[1] : 'Undef', |
|
51
|
|
|
|
|
|
|
$_[0][1]; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub validate { |
|
55
|
0
|
0
|
|
0
|
|
0
|
$_[0][0]->( $_[1] ) |
|
56
|
|
|
|
|
|
|
? undef |
|
57
|
|
|
|
|
|
|
: $_[0]->get_message( $_[1] ); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub assert_valid { |
|
61
|
0
|
0
|
|
0
|
|
0
|
$_[0][0]->( $_[1] ) |
|
62
|
|
|
|
|
|
|
? 1 |
|
63
|
|
|
|
|
|
|
: Carp::croak( $_[0]->get_message( $_[1] ) ); |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub assert_return { |
|
67
|
0
|
0
|
|
0
|
|
0
|
$_[0][0]->( $_[1] ) |
|
68
|
|
|
|
|
|
|
? $_[1] |
|
69
|
|
|
|
|
|
|
: Carp::croak( $_[0]->get_message( $_[1] ) ); |
|
70
|
|
|
|
|
|
|
} |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub to_TypeTiny { |
|
73
|
0
|
|
|
0
|
|
0
|
my ( $coderef, $name, $library, $origname ) = @{ +shift }; |
|
|
0
|
|
|
|
|
0
|
|
|
74
|
0
|
0
|
|
|
|
0
|
if ( ref $library eq 'ARRAY' ) { |
|
75
|
0
|
|
|
|
|
0
|
require Type::Tiny::Union; |
|
76
|
0
|
|
|
|
|
0
|
return 'Type::Tiny::Union'->new( |
|
77
|
|
|
|
|
|
|
type_constraints => [ map $_->to_TypeTiny, @$library ], |
|
78
|
|
|
|
|
|
|
); |
|
79
|
|
|
|
|
|
|
} |
|
80
|
0
|
0
|
|
|
|
0
|
if ( $library ) { |
|
81
|
0
|
|
|
|
|
0
|
local $@; |
|
82
|
0
|
0
|
|
|
|
0
|
eval "require $library; 1" or die $@; |
|
83
|
0
|
|
|
|
|
0
|
my $type = $library->get_type( $origname ); |
|
84
|
0
|
0
|
|
|
|
0
|
return $type if $type; |
|
85
|
|
|
|
|
|
|
} |
|
86
|
0
|
|
|
|
|
0
|
require Type::Tiny; |
|
87
|
|
|
|
|
|
|
return 'Type::Tiny'->new( |
|
88
|
|
|
|
|
|
|
name => $name, |
|
89
|
0
|
|
|
0
|
|
0
|
constraint => sub { $coderef->( $_ ) }, |
|
90
|
0
|
|
|
0
|
|
0
|
inlined => sub { sprintf '%s::is_%s(%s)', $LIBRARY, $name, pop } |
|
91
|
0
|
|
|
|
|
0
|
); |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub DOES { |
|
95
|
0
|
0
|
|
0
|
|
0
|
return 1 if $_[1] eq 'Type::API::Constraint'; |
|
96
|
0
|
0
|
|
|
|
0
|
return 1 if $_[1] eq 'Type::Library::Compiler::TypeConstraint'; |
|
97
|
0
|
|
|
|
|
0
|
shift->DOES( @_ ); |
|
98
|
|
|
|
|
|
|
} |
|
99
|
|
|
|
|
|
|
}; |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# Any |
|
102
|
|
|
|
|
|
|
{ |
|
103
|
|
|
|
|
|
|
my $type; |
|
104
|
|
|
|
|
|
|
sub Any () { |
|
105
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Any, "Any", "Types::Standard", "Any" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub is_Any ($) { |
|
109
|
0
|
|
|
0
|
0
|
0
|
(!!1) |
|
110
|
|
|
|
|
|
|
} |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub assert_Any ($) { |
|
113
|
0
|
|
|
0
|
0
|
0
|
(!!1) ? $_[0] : Any->get_message( $_[0] ); |
|
114
|
|
|
|
|
|
|
} |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
$EXPORT_TAGS{"Any"} = [ qw( Any is_Any assert_Any ) ]; |
|
117
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Any"} }; |
|
118
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Any"; |
|
119
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Any"; |
|
120
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Any"; |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
# ArrayRef |
|
125
|
|
|
|
|
|
|
{ |
|
126
|
|
|
|
|
|
|
my $type; |
|
127
|
|
|
|
|
|
|
sub ArrayRef () { |
|
128
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_ArrayRef, "ArrayRef", "Types::Standard", "ArrayRef" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub is_ArrayRef ($) { |
|
132
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'ARRAY') |
|
133
|
|
|
|
|
|
|
} |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub assert_ArrayRef ($) { |
|
136
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'ARRAY') ? $_[0] : ArrayRef->get_message( $_[0] ); |
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
$EXPORT_TAGS{"ArrayRef"} = [ qw( ArrayRef is_ArrayRef assert_ArrayRef ) ]; |
|
140
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"ArrayRef"} }; |
|
141
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "ArrayRef"; |
|
142
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_ArrayRef"; |
|
143
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_ArrayRef"; |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
# Bool |
|
148
|
|
|
|
|
|
|
{ |
|
149
|
|
|
|
|
|
|
my $type; |
|
150
|
|
|
|
|
|
|
sub Bool () { |
|
151
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Bool, "Bool", "Types::Standard", "Bool" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
152
|
|
|
|
|
|
|
} |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub is_Bool ($) { |
|
155
|
0
|
0
|
0
|
0
|
0
|
0
|
(!ref $_[0] and (!defined $_[0] or $_[0] eq q() or $_[0] eq '0' or $_[0] eq '1')) |
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
156
|
|
|
|
|
|
|
} |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
sub assert_Bool ($) { |
|
159
|
0
|
0
|
0
|
0
|
0
|
0
|
(!ref $_[0] and (!defined $_[0] or $_[0] eq q() or $_[0] eq '0' or $_[0] eq '1')) ? $_[0] : Bool->get_message( $_[0] ); |
|
160
|
|
|
|
|
|
|
} |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
$EXPORT_TAGS{"Bool"} = [ qw( Bool is_Bool assert_Bool ) ]; |
|
163
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Bool"} }; |
|
164
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Bool"; |
|
165
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Bool"; |
|
166
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Bool"; |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
} |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
# Card |
|
171
|
|
|
|
|
|
|
{ |
|
172
|
|
|
|
|
|
|
my $type; |
|
173
|
|
|
|
|
|
|
sub Card () { |
|
174
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Card, "Card", "Acme::Mitey::Cards::Types::Source", "Card" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
175
|
|
|
|
|
|
|
} |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
sub is_Card ($) { |
|
178
|
9
|
0
|
|
9
|
0
|
76
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card]) }) |
|
|
9
|
|
|
0
|
|
17
|
|
|
|
9
|
|
|
|
|
554
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
179
|
|
|
|
|
|
|
} |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub assert_Card ($) { |
|
182
|
9
|
0
|
|
9
|
0
|
58
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card]) }) ? $_[0] : Card->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
16
|
|
|
|
9
|
|
|
|
|
1629
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
183
|
|
|
|
|
|
|
} |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
$EXPORT_TAGS{"Card"} = [ qw( Card is_Card assert_Card ) ]; |
|
186
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Card"} }; |
|
187
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Card"; |
|
188
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Card"; |
|
189
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Card"; |
|
190
|
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
# CardArray |
|
194
|
|
|
|
|
|
|
{ |
|
195
|
|
|
|
|
|
|
my $type; |
|
196
|
|
|
|
|
|
|
sub CardArray () { |
|
197
|
6
|
|
100
|
6
|
0
|
111
|
$type ||= bless( [ \&is_CardArray, "CardArray", "Acme::Mitey::Cards::Types::Source", "CardArray" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
198
|
|
|
|
|
|
|
} |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
sub is_CardArray ($) { |
|
201
|
9
|
0
|
|
9
|
0
|
64
|
do { (ref($_[0]) eq 'ARRAY') and do { my $ok = 1; for my $i (@{$_[0]}) { ($ok = 0, last) unless (do { use Scalar::Util (); Scalar::Util::blessed($i) and $i->isa(q[Acme::Mitey::Cards::Card]) }) }; $ok } } |
|
|
9
|
0
|
|
0
|
|
19
|
|
|
|
9
|
0
|
|
|
|
941
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
202
|
|
|
|
|
|
|
} |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub assert_CardArray ($) { |
|
205
|
9
|
0
|
|
9
|
0
|
55
|
do { (ref($_[0]) eq 'ARRAY') and do { my $ok = 1; for my $i (@{$_[0]}) { ($ok = 0, last) unless (do { use Scalar::Util (); Scalar::Util::blessed($i) and $i->isa(q[Acme::Mitey::Cards::Card]) }) }; $ok } } ? $_[0] : CardArray->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
42
|
|
|
|
9
|
0
|
|
|
|
6426
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
206
|
|
|
|
|
|
|
} |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
$EXPORT_TAGS{"CardArray"} = [ qw( CardArray is_CardArray assert_CardArray ) ]; |
|
209
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"CardArray"} }; |
|
210
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "CardArray"; |
|
211
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_CardArray"; |
|
212
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_CardArray"; |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
} |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
# CardNumber |
|
217
|
|
|
|
|
|
|
{ |
|
218
|
|
|
|
|
|
|
my $type; |
|
219
|
|
|
|
|
|
|
sub CardNumber () { |
|
220
|
3
|
|
50
|
3
|
0
|
17
|
$type ||= bless( [ \&is_CardNumber, "CardNumber", "Acme::Mitey::Cards::Types::Source", "CardNumber" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
221
|
|
|
|
|
|
|
} |
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
sub is_CardNumber ($) { |
|
224
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= 1) && ($_[0] <= 10)) |
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
225
|
|
|
|
|
|
|
} |
|
226
|
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
sub assert_CardNumber ($) { |
|
228
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= 1) && ($_[0] <= 10)) ? $_[0] : CardNumber->get_message( $_[0] ); |
|
229
|
|
|
|
|
|
|
} |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
$EXPORT_TAGS{"CardNumber"} = [ qw( CardNumber is_CardNumber assert_CardNumber ) ]; |
|
232
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"CardNumber"} }; |
|
233
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "CardNumber"; |
|
234
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_CardNumber"; |
|
235
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_CardNumber"; |
|
236
|
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
} |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
# Character |
|
240
|
|
|
|
|
|
|
{ |
|
241
|
|
|
|
|
|
|
my $type; |
|
242
|
|
|
|
|
|
|
sub Character () { |
|
243
|
3
|
|
50
|
3
|
0
|
24
|
$type ||= bless( [ \&is_Character, "Character", "Acme::Mitey::Cards::Types::Source", "Character" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
244
|
|
|
|
|
|
|
} |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
sub is_Character ($) { |
|
247
|
0
|
0
|
0
|
0
|
0
|
0
|
do { (defined($_[0]) and !ref($_[0]) and $_[0] =~ m{\A(?:(?:Jack|King|Queen))\z}) } |
|
|
0
|
|
|
|
|
0
|
|
|
248
|
|
|
|
|
|
|
} |
|
249
|
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
sub assert_Character ($) { |
|
251
|
0
|
0
|
0
|
0
|
0
|
0
|
do { (defined($_[0]) and !ref($_[0]) and $_[0] =~ m{\A(?:(?:Jack|King|Queen))\z}) } ? $_[0] : Character->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
252
|
|
|
|
|
|
|
} |
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
$EXPORT_TAGS{"Character"} = [ qw( Character is_Character assert_Character ) ]; |
|
255
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Character"} }; |
|
256
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Character"; |
|
257
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Character"; |
|
258
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Character"; |
|
259
|
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
} |
|
261
|
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
# ClassName |
|
263
|
|
|
|
|
|
|
{ |
|
264
|
|
|
|
|
|
|
my $type; |
|
265
|
|
|
|
|
|
|
sub ClassName () { |
|
266
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_ClassName, "ClassName", "Types::Standard", "ClassName" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
267
|
|
|
|
|
|
|
} |
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
sub is_ClassName ($) { |
|
270
|
0
|
|
|
0
|
0
|
0
|
do { (sub { |
|
271
|
9
|
|
|
9
|
|
59
|
no strict 'refs'; |
|
|
9
|
|
|
|
|
40
|
|
|
|
9
|
|
|
|
|
1979
|
|
|
272
|
0
|
0
|
|
0
|
|
0
|
return !!0 if ref $_[0]; |
|
273
|
0
|
0
|
|
|
|
0
|
return !!0 if not $_[0]; |
|
274
|
0
|
0
|
|
|
|
0
|
return !!0 if ref(do { my $tmpstr = $_[0]; \$tmpstr }) ne 'SCALAR'; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
275
|
0
|
|
|
|
|
0
|
my $stash = \%{"$_[0]\::"}; |
|
|
0
|
|
|
|
|
0
|
|
|
276
|
0
|
0
|
0
|
|
|
0
|
return !!1 if exists($stash->{'ISA'}) && *{$stash->{'ISA'}}{ARRAY} && @{$_[0].'::ISA'}; |
|
|
0
|
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
277
|
0
|
0
|
|
|
|
0
|
return !!1 if exists($stash->{'VERSION'}); |
|
278
|
0
|
|
|
|
|
0
|
foreach my $globref (values %$stash) { |
|
279
|
|
|
|
|
|
|
return !!1 |
|
280
|
|
|
|
|
|
|
if ref \$globref eq 'GLOB' |
|
281
|
0
|
|
|
|
|
0
|
? *{$globref}{CODE} |
|
282
|
0
|
0
|
|
|
|
0
|
: ref $globref; # const or sub ref |
|
|
|
0
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
} |
|
284
|
0
|
|
|
|
|
0
|
return !!0; |
|
285
|
0
|
|
|
|
|
0
|
})->(do { my $tmp = $_[0] }) } |
|
|
0
|
|
|
|
|
0
|
|
|
286
|
|
|
|
|
|
|
} |
|
287
|
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
sub assert_ClassName ($) { |
|
289
|
0
|
0
|
|
0
|
0
|
0
|
do { (sub { |
|
290
|
9
|
|
|
9
|
|
59
|
no strict 'refs'; |
|
|
9
|
|
|
|
|
22
|
|
|
|
9
|
|
|
|
|
4229
|
|
|
291
|
0
|
0
|
|
0
|
|
0
|
return !!0 if ref $_[0]; |
|
292
|
0
|
0
|
|
|
|
0
|
return !!0 if not $_[0]; |
|
293
|
0
|
0
|
|
|
|
0
|
return !!0 if ref(do { my $tmpstr = $_[0]; \$tmpstr }) ne 'SCALAR'; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
294
|
0
|
|
|
|
|
0
|
my $stash = \%{"$_[0]\::"}; |
|
|
0
|
|
|
|
|
0
|
|
|
295
|
0
|
0
|
0
|
|
|
0
|
return !!1 if exists($stash->{'ISA'}) && *{$stash->{'ISA'}}{ARRAY} && @{$_[0].'::ISA'}; |
|
|
0
|
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
296
|
0
|
0
|
|
|
|
0
|
return !!1 if exists($stash->{'VERSION'}); |
|
297
|
0
|
|
|
|
|
0
|
foreach my $globref (values %$stash) { |
|
298
|
|
|
|
|
|
|
return !!1 |
|
299
|
|
|
|
|
|
|
if ref \$globref eq 'GLOB' |
|
300
|
0
|
|
|
|
|
0
|
? *{$globref}{CODE} |
|
301
|
0
|
0
|
|
|
|
0
|
: ref $globref; # const or sub ref |
|
|
|
0
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
} |
|
303
|
0
|
|
|
|
|
0
|
return !!0; |
|
304
|
0
|
|
|
|
|
0
|
})->(do { my $tmp = $_[0] }) } ? $_[0] : ClassName->get_message( $_[0] ); |
|
|
0
|
|
|
|
|
0
|
|
|
305
|
|
|
|
|
|
|
} |
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
$EXPORT_TAGS{"ClassName"} = [ qw( ClassName is_ClassName assert_ClassName ) ]; |
|
308
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"ClassName"} }; |
|
309
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "ClassName"; |
|
310
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_ClassName"; |
|
311
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_ClassName"; |
|
312
|
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
} |
|
314
|
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
# CodeRef |
|
316
|
|
|
|
|
|
|
{ |
|
317
|
|
|
|
|
|
|
my $type; |
|
318
|
|
|
|
|
|
|
sub CodeRef () { |
|
319
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_CodeRef, "CodeRef", "Types::Standard", "CodeRef" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
320
|
|
|
|
|
|
|
} |
|
321
|
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
sub is_CodeRef ($) { |
|
323
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'CODE') |
|
324
|
|
|
|
|
|
|
} |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
sub assert_CodeRef ($) { |
|
327
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'CODE') ? $_[0] : CodeRef->get_message( $_[0] ); |
|
328
|
|
|
|
|
|
|
} |
|
329
|
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
$EXPORT_TAGS{"CodeRef"} = [ qw( CodeRef is_CodeRef assert_CodeRef ) ]; |
|
331
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"CodeRef"} }; |
|
332
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "CodeRef"; |
|
333
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_CodeRef"; |
|
334
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_CodeRef"; |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
} |
|
337
|
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
# ConsumerOf |
|
339
|
|
|
|
|
|
|
{ |
|
340
|
|
|
|
|
|
|
my $type; |
|
341
|
|
|
|
|
|
|
sub ConsumerOf () { |
|
342
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_ConsumerOf, "ConsumerOf", "Types::Standard", "ConsumerOf" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
343
|
|
|
|
|
|
|
} |
|
344
|
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
sub is_ConsumerOf ($) { |
|
346
|
9
|
|
|
9
|
0
|
85
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) |
|
|
9
|
|
|
0
|
|
31
|
|
|
|
9
|
|
|
|
|
417
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
347
|
|
|
|
|
|
|
} |
|
348
|
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
sub assert_ConsumerOf ($) { |
|
350
|
9
|
0
|
|
9
|
0
|
49
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) ? $_[0] : ConsumerOf->get_message( $_[0] ); |
|
|
9
|
|
|
0
|
|
27
|
|
|
|
9
|
|
|
|
|
2919
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
351
|
|
|
|
|
|
|
} |
|
352
|
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
$EXPORT_TAGS{"ConsumerOf"} = [ qw( ConsumerOf is_ConsumerOf assert_ConsumerOf ) ]; |
|
354
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"ConsumerOf"} }; |
|
355
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "ConsumerOf"; |
|
356
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_ConsumerOf"; |
|
357
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_ConsumerOf"; |
|
358
|
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
} |
|
360
|
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
# CycleTuple |
|
362
|
|
|
|
|
|
|
{ |
|
363
|
|
|
|
|
|
|
my $type; |
|
364
|
|
|
|
|
|
|
sub CycleTuple () { |
|
365
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_CycleTuple, "CycleTuple", "Types::Standard", "CycleTuple" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
366
|
|
|
|
|
|
|
} |
|
367
|
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
sub is_CycleTuple ($) { |
|
369
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'ARRAY') |
|
370
|
|
|
|
|
|
|
} |
|
371
|
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
sub assert_CycleTuple ($) { |
|
373
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'ARRAY') ? $_[0] : CycleTuple->get_message( $_[0] ); |
|
374
|
|
|
|
|
|
|
} |
|
375
|
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
$EXPORT_TAGS{"CycleTuple"} = [ qw( CycleTuple is_CycleTuple assert_CycleTuple ) ]; |
|
377
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"CycleTuple"} }; |
|
378
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "CycleTuple"; |
|
379
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_CycleTuple"; |
|
380
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_CycleTuple"; |
|
381
|
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
} |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
# Deck |
|
385
|
|
|
|
|
|
|
{ |
|
386
|
|
|
|
|
|
|
my $type; |
|
387
|
|
|
|
|
|
|
sub Deck () { |
|
388
|
8
|
|
50
|
8
|
0
|
228
|
$type ||= bless( [ \&is_Deck, "Deck", "Acme::Mitey::Cards::Types::Source", "Deck" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
389
|
|
|
|
|
|
|
} |
|
390
|
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
sub is_Deck ($) { |
|
392
|
9
|
0
|
|
9
|
0
|
55
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Deck]) }) |
|
|
9
|
|
|
0
|
|
15
|
|
|
|
9
|
|
|
|
|
523
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
393
|
|
|
|
|
|
|
} |
|
394
|
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
sub assert_Deck ($) { |
|
396
|
9
|
0
|
|
9
|
0
|
48
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Deck]) }) ? $_[0] : Deck->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
23
|
|
|
|
9
|
|
|
|
|
5998
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
397
|
|
|
|
|
|
|
} |
|
398
|
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
$EXPORT_TAGS{"Deck"} = [ qw( Deck is_Deck assert_Deck ) ]; |
|
400
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Deck"} }; |
|
401
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Deck"; |
|
402
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Deck"; |
|
403
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Deck"; |
|
404
|
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
} |
|
406
|
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
# Defined |
|
408
|
|
|
|
|
|
|
{ |
|
409
|
|
|
|
|
|
|
my $type; |
|
410
|
|
|
|
|
|
|
sub Defined () { |
|
411
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Defined, "Defined", "Types::Standard", "Defined" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
412
|
|
|
|
|
|
|
} |
|
413
|
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
sub is_Defined ($) { |
|
415
|
0
|
|
|
0
|
0
|
0
|
(defined($_[0])) |
|
416
|
|
|
|
|
|
|
} |
|
417
|
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
sub assert_Defined ($) { |
|
419
|
0
|
0
|
|
0
|
0
|
0
|
(defined($_[0])) ? $_[0] : Defined->get_message( $_[0] ); |
|
420
|
|
|
|
|
|
|
} |
|
421
|
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
$EXPORT_TAGS{"Defined"} = [ qw( Defined is_Defined assert_Defined ) ]; |
|
423
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Defined"} }; |
|
424
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Defined"; |
|
425
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Defined"; |
|
426
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Defined"; |
|
427
|
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
} |
|
429
|
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
# Dict |
|
431
|
|
|
|
|
|
|
{ |
|
432
|
|
|
|
|
|
|
my $type; |
|
433
|
|
|
|
|
|
|
sub Dict () { |
|
434
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Dict, "Dict", "Types::Standard", "Dict" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
435
|
|
|
|
|
|
|
} |
|
436
|
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
sub is_Dict ($) { |
|
438
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') |
|
439
|
|
|
|
|
|
|
} |
|
440
|
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
sub assert_Dict ($) { |
|
442
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') ? $_[0] : Dict->get_message( $_[0] ); |
|
443
|
|
|
|
|
|
|
} |
|
444
|
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
$EXPORT_TAGS{"Dict"} = [ qw( Dict is_Dict assert_Dict ) ]; |
|
446
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Dict"} }; |
|
447
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Dict"; |
|
448
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Dict"; |
|
449
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Dict"; |
|
450
|
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
} |
|
452
|
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
# Enum |
|
454
|
|
|
|
|
|
|
{ |
|
455
|
|
|
|
|
|
|
my $type; |
|
456
|
|
|
|
|
|
|
sub Enum () { |
|
457
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Enum, "Enum", "Types::Standard", "Enum" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
458
|
|
|
|
|
|
|
} |
|
459
|
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
sub is_Enum ($) { |
|
461
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
462
|
|
|
|
|
|
|
} |
|
463
|
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
sub assert_Enum ($) { |
|
465
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } ? $_[0] : Enum->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
466
|
|
|
|
|
|
|
} |
|
467
|
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
$EXPORT_TAGS{"Enum"} = [ qw( Enum is_Enum assert_Enum ) ]; |
|
469
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Enum"} }; |
|
470
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Enum"; |
|
471
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Enum"; |
|
472
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Enum"; |
|
473
|
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
} |
|
475
|
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
# FaceCard |
|
477
|
|
|
|
|
|
|
{ |
|
478
|
|
|
|
|
|
|
my $type; |
|
479
|
|
|
|
|
|
|
sub FaceCard () { |
|
480
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_FaceCard, "FaceCard", "Acme::Mitey::Cards::Types::Source", "FaceCard" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
481
|
|
|
|
|
|
|
} |
|
482
|
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
sub is_FaceCard ($) { |
|
484
|
9
|
0
|
|
9
|
0
|
59
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Face]) }) |
|
|
9
|
|
|
0
|
|
19
|
|
|
|
9
|
|
|
|
|
509
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
485
|
|
|
|
|
|
|
} |
|
486
|
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
sub assert_FaceCard ($) { |
|
488
|
9
|
0
|
|
9
|
0
|
52
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Face]) }) ? $_[0] : FaceCard->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
16
|
|
|
|
9
|
|
|
|
|
1363
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
489
|
|
|
|
|
|
|
} |
|
490
|
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
$EXPORT_TAGS{"FaceCard"} = [ qw( FaceCard is_FaceCard assert_FaceCard ) ]; |
|
492
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"FaceCard"} }; |
|
493
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "FaceCard"; |
|
494
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_FaceCard"; |
|
495
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_FaceCard"; |
|
496
|
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
} |
|
498
|
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
# FileHandle |
|
500
|
|
|
|
|
|
|
{ |
|
501
|
|
|
|
|
|
|
my $type; |
|
502
|
|
|
|
|
|
|
sub FileHandle () { |
|
503
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_FileHandle, "FileHandle", "Types::Standard", "FileHandle" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
504
|
|
|
|
|
|
|
} |
|
505
|
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
sub is_FileHandle ($) { |
|
507
|
9
|
0
|
0
|
9
|
0
|
60
|
(do { use Scalar::Util (); (ref($_[0]) && Scalar::Util::openhandle($_[0])) or (Scalar::Util::blessed($_[0]) && $_[0]->isa("IO::Handle")) }) |
|
|
9
|
|
0
|
0
|
|
20
|
|
|
|
9
|
|
|
|
|
648
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
508
|
|
|
|
|
|
|
} |
|
509
|
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
sub assert_FileHandle ($) { |
|
511
|
9
|
0
|
0
|
9
|
0
|
51
|
(do { use Scalar::Util (); (ref($_[0]) && Scalar::Util::openhandle($_[0])) or (Scalar::Util::blessed($_[0]) && $_[0]->isa("IO::Handle")) }) ? $_[0] : FileHandle->get_message( $_[0] ); |
|
|
9
|
0
|
0
|
0
|
|
13
|
|
|
|
9
|
|
|
|
|
3219
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
512
|
|
|
|
|
|
|
} |
|
513
|
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
$EXPORT_TAGS{"FileHandle"} = [ qw( FileHandle is_FileHandle assert_FileHandle ) ]; |
|
515
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"FileHandle"} }; |
|
516
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "FileHandle"; |
|
517
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_FileHandle"; |
|
518
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_FileHandle"; |
|
519
|
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
} |
|
521
|
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
# GlobRef |
|
523
|
|
|
|
|
|
|
{ |
|
524
|
|
|
|
|
|
|
my $type; |
|
525
|
|
|
|
|
|
|
sub GlobRef () { |
|
526
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_GlobRef, "GlobRef", "Types::Standard", "GlobRef" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
527
|
|
|
|
|
|
|
} |
|
528
|
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
sub is_GlobRef ($) { |
|
530
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'GLOB') |
|
531
|
|
|
|
|
|
|
} |
|
532
|
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
sub assert_GlobRef ($) { |
|
534
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'GLOB') ? $_[0] : GlobRef->get_message( $_[0] ); |
|
535
|
|
|
|
|
|
|
} |
|
536
|
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
$EXPORT_TAGS{"GlobRef"} = [ qw( GlobRef is_GlobRef assert_GlobRef ) ]; |
|
538
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"GlobRef"} }; |
|
539
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "GlobRef"; |
|
540
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_GlobRef"; |
|
541
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_GlobRef"; |
|
542
|
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
} |
|
544
|
|
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
# Hand |
|
546
|
|
|
|
|
|
|
{ |
|
547
|
|
|
|
|
|
|
my $type; |
|
548
|
|
|
|
|
|
|
sub Hand () { |
|
549
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Hand, "Hand", "Acme::Mitey::Cards::Types::Source", "Hand" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
550
|
|
|
|
|
|
|
} |
|
551
|
|
|
|
|
|
|
|
|
552
|
|
|
|
|
|
|
sub is_Hand ($) { |
|
553
|
9
|
0
|
|
9
|
0
|
57
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Hand]) }) |
|
|
9
|
|
|
0
|
|
12
|
|
|
|
9
|
|
|
|
|
510
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
554
|
|
|
|
|
|
|
} |
|
555
|
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
sub assert_Hand ($) { |
|
557
|
9
|
0
|
|
9
|
0
|
54
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Hand]) }) ? $_[0] : Hand->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
27
|
|
|
|
9
|
|
|
|
|
1538
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
558
|
|
|
|
|
|
|
} |
|
559
|
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
$EXPORT_TAGS{"Hand"} = [ qw( Hand is_Hand assert_Hand ) ]; |
|
561
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Hand"} }; |
|
562
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Hand"; |
|
563
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Hand"; |
|
564
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Hand"; |
|
565
|
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
} |
|
567
|
|
|
|
|
|
|
|
|
568
|
|
|
|
|
|
|
# HasMethods |
|
569
|
|
|
|
|
|
|
{ |
|
570
|
|
|
|
|
|
|
my $type; |
|
571
|
|
|
|
|
|
|
sub HasMethods () { |
|
572
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_HasMethods, "HasMethods", "Types::Standard", "HasMethods" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
573
|
|
|
|
|
|
|
} |
|
574
|
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
sub is_HasMethods ($) { |
|
576
|
9
|
|
|
9
|
0
|
56
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) |
|
|
9
|
|
|
0
|
|
21
|
|
|
|
9
|
|
|
|
|
462
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
577
|
|
|
|
|
|
|
} |
|
578
|
|
|
|
|
|
|
|
|
579
|
|
|
|
|
|
|
sub assert_HasMethods ($) { |
|
580
|
9
|
0
|
|
9
|
0
|
56
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) ? $_[0] : HasMethods->get_message( $_[0] ); |
|
|
9
|
|
|
0
|
|
21
|
|
|
|
9
|
|
|
|
|
2897
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
581
|
|
|
|
|
|
|
} |
|
582
|
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
$EXPORT_TAGS{"HasMethods"} = [ qw( HasMethods is_HasMethods assert_HasMethods ) ]; |
|
584
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"HasMethods"} }; |
|
585
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "HasMethods"; |
|
586
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_HasMethods"; |
|
587
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_HasMethods"; |
|
588
|
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
} |
|
590
|
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
# HashRef |
|
592
|
|
|
|
|
|
|
{ |
|
593
|
|
|
|
|
|
|
my $type; |
|
594
|
|
|
|
|
|
|
sub HashRef () { |
|
595
|
2
|
|
50
|
2
|
0
|
14
|
$type ||= bless( [ \&is_HashRef, "HashRef", "Types::Standard", "HashRef" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
596
|
|
|
|
|
|
|
} |
|
597
|
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
sub is_HashRef ($) { |
|
599
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') |
|
600
|
|
|
|
|
|
|
} |
|
601
|
|
|
|
|
|
|
|
|
602
|
|
|
|
|
|
|
sub assert_HashRef ($) { |
|
603
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') ? $_[0] : HashRef->get_message( $_[0] ); |
|
604
|
|
|
|
|
|
|
} |
|
605
|
|
|
|
|
|
|
|
|
606
|
|
|
|
|
|
|
$EXPORT_TAGS{"HashRef"} = [ qw( HashRef is_HashRef assert_HashRef ) ]; |
|
607
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"HashRef"} }; |
|
608
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "HashRef"; |
|
609
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_HashRef"; |
|
610
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_HashRef"; |
|
611
|
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
} |
|
613
|
|
|
|
|
|
|
|
|
614
|
|
|
|
|
|
|
# InstanceOf |
|
615
|
|
|
|
|
|
|
{ |
|
616
|
|
|
|
|
|
|
my $type; |
|
617
|
|
|
|
|
|
|
sub InstanceOf () { |
|
618
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_InstanceOf, "InstanceOf", "Types::Standard", "InstanceOf" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
619
|
|
|
|
|
|
|
} |
|
620
|
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
sub is_InstanceOf ($) { |
|
622
|
9
|
|
|
9
|
0
|
67
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) |
|
|
9
|
|
|
0
|
|
33
|
|
|
|
9
|
|
|
|
|
405
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
623
|
|
|
|
|
|
|
} |
|
624
|
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
sub assert_InstanceOf ($) { |
|
626
|
9
|
0
|
|
9
|
0
|
47
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) ? $_[0] : InstanceOf->get_message( $_[0] ); |
|
|
9
|
|
|
0
|
|
15
|
|
|
|
9
|
|
|
|
|
6830
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
627
|
|
|
|
|
|
|
} |
|
628
|
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
$EXPORT_TAGS{"InstanceOf"} = [ qw( InstanceOf is_InstanceOf assert_InstanceOf ) ]; |
|
630
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"InstanceOf"} }; |
|
631
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "InstanceOf"; |
|
632
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_InstanceOf"; |
|
633
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_InstanceOf"; |
|
634
|
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
} |
|
636
|
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
# Int |
|
638
|
|
|
|
|
|
|
{ |
|
639
|
|
|
|
|
|
|
my $type; |
|
640
|
|
|
|
|
|
|
sub Int () { |
|
641
|
6
|
|
100
|
6
|
0
|
44
|
$type ||= bless( [ \&is_Int, "Int", "Types::Standard", "Int" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
642
|
|
|
|
|
|
|
} |
|
643
|
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
sub is_Int ($) { |
|
645
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
646
|
|
|
|
|
|
|
} |
|
647
|
|
|
|
|
|
|
|
|
648
|
|
|
|
|
|
|
sub assert_Int ($) { |
|
649
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) ? $_[0] : Int->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
650
|
|
|
|
|
|
|
} |
|
651
|
|
|
|
|
|
|
|
|
652
|
|
|
|
|
|
|
$EXPORT_TAGS{"Int"} = [ qw( Int is_Int assert_Int ) ]; |
|
653
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Int"} }; |
|
654
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Int"; |
|
655
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Int"; |
|
656
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Int"; |
|
657
|
|
|
|
|
|
|
|
|
658
|
|
|
|
|
|
|
} |
|
659
|
|
|
|
|
|
|
|
|
660
|
|
|
|
|
|
|
# IntRange |
|
661
|
|
|
|
|
|
|
{ |
|
662
|
|
|
|
|
|
|
my $type; |
|
663
|
|
|
|
|
|
|
sub IntRange () { |
|
664
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_IntRange, "IntRange", "Types::Common::Numeric", "IntRange" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
665
|
|
|
|
|
|
|
} |
|
666
|
|
|
|
|
|
|
|
|
667
|
|
|
|
|
|
|
sub is_IntRange ($) { |
|
668
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
669
|
|
|
|
|
|
|
} |
|
670
|
|
|
|
|
|
|
|
|
671
|
|
|
|
|
|
|
sub assert_IntRange ($) { |
|
672
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) ? $_[0] : IntRange->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
673
|
|
|
|
|
|
|
} |
|
674
|
|
|
|
|
|
|
|
|
675
|
|
|
|
|
|
|
$EXPORT_TAGS{"IntRange"} = [ qw( IntRange is_IntRange assert_IntRange ) ]; |
|
676
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"IntRange"} }; |
|
677
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "IntRange"; |
|
678
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_IntRange"; |
|
679
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_IntRange"; |
|
680
|
|
|
|
|
|
|
|
|
681
|
|
|
|
|
|
|
} |
|
682
|
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
# Item |
|
684
|
|
|
|
|
|
|
{ |
|
685
|
|
|
|
|
|
|
my $type; |
|
686
|
|
|
|
|
|
|
sub Item () { |
|
687
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Item, "Item", "Types::Standard", "Item" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
688
|
|
|
|
|
|
|
} |
|
689
|
|
|
|
|
|
|
|
|
690
|
|
|
|
|
|
|
sub is_Item ($) { |
|
691
|
0
|
|
|
0
|
0
|
0
|
(!!1) |
|
692
|
|
|
|
|
|
|
} |
|
693
|
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
sub assert_Item ($) { |
|
695
|
0
|
|
|
0
|
0
|
0
|
(!!1) ? $_[0] : Item->get_message( $_[0] ); |
|
696
|
|
|
|
|
|
|
} |
|
697
|
|
|
|
|
|
|
|
|
698
|
|
|
|
|
|
|
$EXPORT_TAGS{"Item"} = [ qw( Item is_Item assert_Item ) ]; |
|
699
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Item"} }; |
|
700
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Item"; |
|
701
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Item"; |
|
702
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Item"; |
|
703
|
|
|
|
|
|
|
|
|
704
|
|
|
|
|
|
|
} |
|
705
|
|
|
|
|
|
|
|
|
706
|
|
|
|
|
|
|
# JokerCard |
|
707
|
|
|
|
|
|
|
{ |
|
708
|
|
|
|
|
|
|
my $type; |
|
709
|
|
|
|
|
|
|
sub JokerCard () { |
|
710
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_JokerCard, "JokerCard", "Acme::Mitey::Cards::Types::Source", "JokerCard" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
711
|
|
|
|
|
|
|
} |
|
712
|
|
|
|
|
|
|
|
|
713
|
|
|
|
|
|
|
sub is_JokerCard ($) { |
|
714
|
9
|
0
|
|
9
|
0
|
65
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Joker]) }) |
|
|
9
|
|
|
0
|
|
14
|
|
|
|
9
|
|
|
|
|
566
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
715
|
|
|
|
|
|
|
} |
|
716
|
|
|
|
|
|
|
|
|
717
|
|
|
|
|
|
|
sub assert_JokerCard ($) { |
|
718
|
9
|
0
|
|
9
|
0
|
50
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Joker]) }) ? $_[0] : JokerCard->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
15
|
|
|
|
9
|
|
|
|
|
1468
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
719
|
|
|
|
|
|
|
} |
|
720
|
|
|
|
|
|
|
|
|
721
|
|
|
|
|
|
|
$EXPORT_TAGS{"JokerCard"} = [ qw( JokerCard is_JokerCard assert_JokerCard ) ]; |
|
722
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"JokerCard"} }; |
|
723
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "JokerCard"; |
|
724
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_JokerCard"; |
|
725
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_JokerCard"; |
|
726
|
|
|
|
|
|
|
|
|
727
|
|
|
|
|
|
|
} |
|
728
|
|
|
|
|
|
|
|
|
729
|
|
|
|
|
|
|
# LaxNum |
|
730
|
|
|
|
|
|
|
{ |
|
731
|
|
|
|
|
|
|
my $type; |
|
732
|
|
|
|
|
|
|
sub LaxNum () { |
|
733
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_LaxNum, "LaxNum", "Types::Standard", "LaxNum" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
734
|
|
|
|
|
|
|
} |
|
735
|
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
sub is_LaxNum ($) { |
|
737
|
9
|
0
|
0
|
9
|
0
|
55
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
|
9
|
|
|
0
|
|
15
|
|
|
|
9
|
|
|
|
|
616
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
738
|
|
|
|
|
|
|
} |
|
739
|
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
sub assert_LaxNum ($) { |
|
741
|
9
|
0
|
0
|
9
|
0
|
60
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) ? $_[0] : LaxNum->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
22
|
|
|
|
9
|
|
|
|
|
2615
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
742
|
|
|
|
|
|
|
} |
|
743
|
|
|
|
|
|
|
|
|
744
|
|
|
|
|
|
|
$EXPORT_TAGS{"LaxNum"} = [ qw( LaxNum is_LaxNum assert_LaxNum ) ]; |
|
745
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"LaxNum"} }; |
|
746
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "LaxNum"; |
|
747
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_LaxNum"; |
|
748
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_LaxNum"; |
|
749
|
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
} |
|
751
|
|
|
|
|
|
|
|
|
752
|
|
|
|
|
|
|
# LowerCaseSimpleStr |
|
753
|
|
|
|
|
|
|
{ |
|
754
|
|
|
|
|
|
|
my $type; |
|
755
|
|
|
|
|
|
|
sub LowerCaseSimpleStr () { |
|
756
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_LowerCaseSimpleStr, "LowerCaseSimpleStr", "Types::Common::String", "LowerCaseSimpleStr" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
757
|
|
|
|
|
|
|
} |
|
758
|
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
sub is_LowerCaseSimpleStr ($) { |
|
760
|
9
|
0
|
0
|
9
|
0
|
4566
|
(do { (do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Upper}/ms }) |
|
|
9
|
0
|
|
0
|
|
114
|
|
|
|
9
|
0
|
|
|
|
124
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
761
|
|
|
|
|
|
|
} |
|
762
|
|
|
|
|
|
|
|
|
763
|
|
|
|
|
|
|
sub assert_LowerCaseSimpleStr ($) { |
|
764
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Upper}/ms }) ? $_[0] : LowerCaseSimpleStr->get_message( $_[0] ); |
|
765
|
|
|
|
|
|
|
} |
|
766
|
|
|
|
|
|
|
|
|
767
|
|
|
|
|
|
|
$EXPORT_TAGS{"LowerCaseSimpleStr"} = [ qw( LowerCaseSimpleStr is_LowerCaseSimpleStr assert_LowerCaseSimpleStr ) ]; |
|
768
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"LowerCaseSimpleStr"} }; |
|
769
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "LowerCaseSimpleStr"; |
|
770
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_LowerCaseSimpleStr"; |
|
771
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_LowerCaseSimpleStr"; |
|
772
|
|
|
|
|
|
|
|
|
773
|
|
|
|
|
|
|
} |
|
774
|
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
# LowerCaseStr |
|
776
|
|
|
|
|
|
|
{ |
|
777
|
|
|
|
|
|
|
my $type; |
|
778
|
|
|
|
|
|
|
sub LowerCaseStr () { |
|
779
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_LowerCaseStr, "LowerCaseStr", "Types::Common::String", "LowerCaseStr" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
780
|
|
|
|
|
|
|
} |
|
781
|
|
|
|
|
|
|
|
|
782
|
|
|
|
|
|
|
sub is_LowerCaseStr ($) { |
|
783
|
0
|
0
|
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Upper}/ms }) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
784
|
|
|
|
|
|
|
} |
|
785
|
|
|
|
|
|
|
|
|
786
|
|
|
|
|
|
|
sub assert_LowerCaseStr ($) { |
|
787
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Upper}/ms }) ? $_[0] : LowerCaseStr->get_message( $_[0] ); |
|
788
|
|
|
|
|
|
|
} |
|
789
|
|
|
|
|
|
|
|
|
790
|
|
|
|
|
|
|
$EXPORT_TAGS{"LowerCaseStr"} = [ qw( LowerCaseStr is_LowerCaseStr assert_LowerCaseStr ) ]; |
|
791
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"LowerCaseStr"} }; |
|
792
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "LowerCaseStr"; |
|
793
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_LowerCaseStr"; |
|
794
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_LowerCaseStr"; |
|
795
|
|
|
|
|
|
|
|
|
796
|
|
|
|
|
|
|
} |
|
797
|
|
|
|
|
|
|
|
|
798
|
|
|
|
|
|
|
# Map |
|
799
|
|
|
|
|
|
|
{ |
|
800
|
|
|
|
|
|
|
my $type; |
|
801
|
|
|
|
|
|
|
sub Map () { |
|
802
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Map, "Map", "Types::Standard", "Map" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
803
|
|
|
|
|
|
|
} |
|
804
|
|
|
|
|
|
|
|
|
805
|
|
|
|
|
|
|
sub is_Map ($) { |
|
806
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') |
|
807
|
|
|
|
|
|
|
} |
|
808
|
|
|
|
|
|
|
|
|
809
|
|
|
|
|
|
|
sub assert_Map ($) { |
|
810
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') ? $_[0] : Map->get_message( $_[0] ); |
|
811
|
|
|
|
|
|
|
} |
|
812
|
|
|
|
|
|
|
|
|
813
|
|
|
|
|
|
|
$EXPORT_TAGS{"Map"} = [ qw( Map is_Map assert_Map ) ]; |
|
814
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Map"} }; |
|
815
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Map"; |
|
816
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Map"; |
|
817
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Map"; |
|
818
|
|
|
|
|
|
|
|
|
819
|
|
|
|
|
|
|
} |
|
820
|
|
|
|
|
|
|
|
|
821
|
|
|
|
|
|
|
# Maybe |
|
822
|
|
|
|
|
|
|
{ |
|
823
|
|
|
|
|
|
|
my $type; |
|
824
|
|
|
|
|
|
|
sub Maybe () { |
|
825
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Maybe, "Maybe", "Types::Standard", "Maybe" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
826
|
|
|
|
|
|
|
} |
|
827
|
|
|
|
|
|
|
|
|
828
|
|
|
|
|
|
|
sub is_Maybe ($) { |
|
829
|
0
|
|
|
0
|
0
|
0
|
(!!1) |
|
830
|
|
|
|
|
|
|
} |
|
831
|
|
|
|
|
|
|
|
|
832
|
|
|
|
|
|
|
sub assert_Maybe ($) { |
|
833
|
0
|
|
|
0
|
0
|
0
|
(!!1) ? $_[0] : Maybe->get_message( $_[0] ); |
|
834
|
|
|
|
|
|
|
} |
|
835
|
|
|
|
|
|
|
|
|
836
|
|
|
|
|
|
|
$EXPORT_TAGS{"Maybe"} = [ qw( Maybe is_Maybe assert_Maybe ) ]; |
|
837
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Maybe"} }; |
|
838
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Maybe"; |
|
839
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Maybe"; |
|
840
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Maybe"; |
|
841
|
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
} |
|
843
|
|
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
# NegativeInt |
|
845
|
|
|
|
|
|
|
{ |
|
846
|
|
|
|
|
|
|
my $type; |
|
847
|
|
|
|
|
|
|
sub NegativeInt () { |
|
848
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_NegativeInt, "NegativeInt", "Types::Common::Numeric", "NegativeInt" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
849
|
|
|
|
|
|
|
} |
|
850
|
|
|
|
|
|
|
|
|
851
|
|
|
|
|
|
|
sub is_NegativeInt ($) { |
|
852
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] < 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
853
|
|
|
|
|
|
|
} |
|
854
|
|
|
|
|
|
|
|
|
855
|
|
|
|
|
|
|
sub assert_NegativeInt ($) { |
|
856
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] < 0)) ? $_[0] : NegativeInt->get_message( $_[0] ); |
|
857
|
|
|
|
|
|
|
} |
|
858
|
|
|
|
|
|
|
|
|
859
|
|
|
|
|
|
|
$EXPORT_TAGS{"NegativeInt"} = [ qw( NegativeInt is_NegativeInt assert_NegativeInt ) ]; |
|
860
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NegativeInt"} }; |
|
861
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NegativeInt"; |
|
862
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NegativeInt"; |
|
863
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NegativeInt"; |
|
864
|
|
|
|
|
|
|
|
|
865
|
|
|
|
|
|
|
} |
|
866
|
|
|
|
|
|
|
|
|
867
|
|
|
|
|
|
|
# NegativeNum |
|
868
|
|
|
|
|
|
|
{ |
|
869
|
|
|
|
|
|
|
my $type; |
|
870
|
|
|
|
|
|
|
sub NegativeNum () { |
|
871
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_NegativeNum, "NegativeNum", "Types::Common::Numeric", "NegativeNum" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
872
|
|
|
|
|
|
|
} |
|
873
|
|
|
|
|
|
|
|
|
874
|
|
|
|
|
|
|
sub is_NegativeNum ($) { |
|
875
|
9
|
0
|
0
|
9
|
0
|
166904
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] < 0)) |
|
|
9
|
0
|
|
0
|
|
20
|
|
|
|
9
|
|
|
|
|
489
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
876
|
|
|
|
|
|
|
} |
|
877
|
|
|
|
|
|
|
|
|
878
|
|
|
|
|
|
|
sub assert_NegativeNum ($) { |
|
879
|
9
|
0
|
0
|
9
|
0
|
42
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] < 0)) ? $_[0] : NegativeNum->get_message( $_[0] ); |
|
|
9
|
|
|
0
|
|
16
|
|
|
|
9
|
|
|
|
|
3041
|
|
|
|
0
|
|
|
|
|
0
|
|
|
880
|
|
|
|
|
|
|
} |
|
881
|
|
|
|
|
|
|
|
|
882
|
|
|
|
|
|
|
$EXPORT_TAGS{"NegativeNum"} = [ qw( NegativeNum is_NegativeNum assert_NegativeNum ) ]; |
|
883
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NegativeNum"} }; |
|
884
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NegativeNum"; |
|
885
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NegativeNum"; |
|
886
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NegativeNum"; |
|
887
|
|
|
|
|
|
|
|
|
888
|
|
|
|
|
|
|
} |
|
889
|
|
|
|
|
|
|
|
|
890
|
|
|
|
|
|
|
# NegativeOrZeroInt |
|
891
|
|
|
|
|
|
|
{ |
|
892
|
|
|
|
|
|
|
my $type; |
|
893
|
|
|
|
|
|
|
sub NegativeOrZeroInt () { |
|
894
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_NegativeOrZeroInt, "NegativeOrZeroInt", "Types::Common::Numeric", "NegativeOrZeroInt" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
895
|
|
|
|
|
|
|
} |
|
896
|
|
|
|
|
|
|
|
|
897
|
|
|
|
|
|
|
sub is_NegativeOrZeroInt ($) { |
|
898
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] <= 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
899
|
|
|
|
|
|
|
} |
|
900
|
|
|
|
|
|
|
|
|
901
|
|
|
|
|
|
|
sub assert_NegativeOrZeroInt ($) { |
|
902
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] <= 0)) ? $_[0] : NegativeOrZeroInt->get_message( $_[0] ); |
|
903
|
|
|
|
|
|
|
} |
|
904
|
|
|
|
|
|
|
|
|
905
|
|
|
|
|
|
|
$EXPORT_TAGS{"NegativeOrZeroInt"} = [ qw( NegativeOrZeroInt is_NegativeOrZeroInt assert_NegativeOrZeroInt ) ]; |
|
906
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NegativeOrZeroInt"} }; |
|
907
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NegativeOrZeroInt"; |
|
908
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NegativeOrZeroInt"; |
|
909
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NegativeOrZeroInt"; |
|
910
|
|
|
|
|
|
|
|
|
911
|
|
|
|
|
|
|
} |
|
912
|
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
# NegativeOrZeroNum |
|
914
|
|
|
|
|
|
|
{ |
|
915
|
|
|
|
|
|
|
my $type; |
|
916
|
|
|
|
|
|
|
sub NegativeOrZeroNum () { |
|
917
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_NegativeOrZeroNum, "NegativeOrZeroNum", "Types::Common::Numeric", "NegativeOrZeroNum" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
918
|
|
|
|
|
|
|
} |
|
919
|
|
|
|
|
|
|
|
|
920
|
|
|
|
|
|
|
sub is_NegativeOrZeroNum ($) { |
|
921
|
9
|
0
|
0
|
9
|
0
|
55
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] <= 0)) |
|
|
9
|
0
|
|
0
|
|
15
|
|
|
|
9
|
|
|
|
|
471
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
922
|
|
|
|
|
|
|
} |
|
923
|
|
|
|
|
|
|
|
|
924
|
|
|
|
|
|
|
sub assert_NegativeOrZeroNum ($) { |
|
925
|
9
|
0
|
0
|
9
|
0
|
42
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] <= 0)) ? $_[0] : NegativeOrZeroNum->get_message( $_[0] ); |
|
|
9
|
|
|
0
|
|
13
|
|
|
|
9
|
|
|
|
|
4962
|
|
|
|
0
|
|
|
|
|
0
|
|
|
926
|
|
|
|
|
|
|
} |
|
927
|
|
|
|
|
|
|
|
|
928
|
|
|
|
|
|
|
$EXPORT_TAGS{"NegativeOrZeroNum"} = [ qw( NegativeOrZeroNum is_NegativeOrZeroNum assert_NegativeOrZeroNum ) ]; |
|
929
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NegativeOrZeroNum"} }; |
|
930
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NegativeOrZeroNum"; |
|
931
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NegativeOrZeroNum"; |
|
932
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NegativeOrZeroNum"; |
|
933
|
|
|
|
|
|
|
|
|
934
|
|
|
|
|
|
|
} |
|
935
|
|
|
|
|
|
|
|
|
936
|
|
|
|
|
|
|
# NonEmptySimpleStr |
|
937
|
|
|
|
|
|
|
{ |
|
938
|
|
|
|
|
|
|
my $type; |
|
939
|
|
|
|
|
|
|
sub NonEmptySimpleStr () { |
|
940
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_NonEmptySimpleStr, "NonEmptySimpleStr", "Types::Common::String", "NonEmptySimpleStr" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
941
|
|
|
|
|
|
|
} |
|
942
|
|
|
|
|
|
|
|
|
943
|
|
|
|
|
|
|
sub is_NonEmptySimpleStr ($) { |
|
944
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
945
|
|
|
|
|
|
|
} |
|
946
|
|
|
|
|
|
|
|
|
947
|
|
|
|
|
|
|
sub assert_NonEmptySimpleStr ($) { |
|
948
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) ? $_[0] : NonEmptySimpleStr->get_message( $_[0] ); |
|
949
|
|
|
|
|
|
|
} |
|
950
|
|
|
|
|
|
|
|
|
951
|
|
|
|
|
|
|
$EXPORT_TAGS{"NonEmptySimpleStr"} = [ qw( NonEmptySimpleStr is_NonEmptySimpleStr assert_NonEmptySimpleStr ) ]; |
|
952
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NonEmptySimpleStr"} }; |
|
953
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NonEmptySimpleStr"; |
|
954
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NonEmptySimpleStr"; |
|
955
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NonEmptySimpleStr"; |
|
956
|
|
|
|
|
|
|
|
|
957
|
|
|
|
|
|
|
} |
|
958
|
|
|
|
|
|
|
|
|
959
|
|
|
|
|
|
|
# NonEmptyStr |
|
960
|
|
|
|
|
|
|
{ |
|
961
|
|
|
|
|
|
|
my $type; |
|
962
|
|
|
|
|
|
|
sub NonEmptyStr () { |
|
963
|
7
|
|
100
|
7
|
0
|
116
|
$type ||= bless( [ \&is_NonEmptyStr, "NonEmptyStr", "Types::Common::String", "NonEmptyStr" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
964
|
|
|
|
|
|
|
} |
|
965
|
|
|
|
|
|
|
|
|
966
|
|
|
|
|
|
|
sub is_NonEmptyStr ($) { |
|
967
|
0
|
0
|
|
0
|
0
|
0
|
((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
968
|
|
|
|
|
|
|
} |
|
969
|
|
|
|
|
|
|
|
|
970
|
|
|
|
|
|
|
sub assert_NonEmptyStr ($) { |
|
971
|
0
|
0
|
0
|
0
|
0
|
0
|
((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) ? $_[0] : NonEmptyStr->get_message( $_[0] ); |
|
972
|
|
|
|
|
|
|
} |
|
973
|
|
|
|
|
|
|
|
|
974
|
|
|
|
|
|
|
$EXPORT_TAGS{"NonEmptyStr"} = [ qw( NonEmptyStr is_NonEmptyStr assert_NonEmptyStr ) ]; |
|
975
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NonEmptyStr"} }; |
|
976
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NonEmptyStr"; |
|
977
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NonEmptyStr"; |
|
978
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NonEmptyStr"; |
|
979
|
|
|
|
|
|
|
|
|
980
|
|
|
|
|
|
|
} |
|
981
|
|
|
|
|
|
|
|
|
982
|
|
|
|
|
|
|
# Num |
|
983
|
|
|
|
|
|
|
{ |
|
984
|
|
|
|
|
|
|
my $type; |
|
985
|
|
|
|
|
|
|
sub Num () { |
|
986
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Num, "Num", "Types::Standard", "Num" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
987
|
|
|
|
|
|
|
} |
|
988
|
|
|
|
|
|
|
|
|
989
|
|
|
|
|
|
|
sub is_Num ($) { |
|
990
|
9
|
0
|
0
|
9
|
0
|
52
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
|
9
|
|
|
0
|
|
18
|
|
|
|
9
|
|
|
|
|
420
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
991
|
|
|
|
|
|
|
} |
|
992
|
|
|
|
|
|
|
|
|
993
|
|
|
|
|
|
|
sub assert_Num ($) { |
|
994
|
9
|
0
|
0
|
9
|
0
|
40
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) ? $_[0] : Num->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
14
|
|
|
|
9
|
|
|
|
|
1231
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
995
|
|
|
|
|
|
|
} |
|
996
|
|
|
|
|
|
|
|
|
997
|
|
|
|
|
|
|
$EXPORT_TAGS{"Num"} = [ qw( Num is_Num assert_Num ) ]; |
|
998
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Num"} }; |
|
999
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Num"; |
|
1000
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Num"; |
|
1001
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Num"; |
|
1002
|
|
|
|
|
|
|
|
|
1003
|
|
|
|
|
|
|
} |
|
1004
|
|
|
|
|
|
|
|
|
1005
|
|
|
|
|
|
|
# NumRange |
|
1006
|
|
|
|
|
|
|
{ |
|
1007
|
|
|
|
|
|
|
my $type; |
|
1008
|
|
|
|
|
|
|
sub NumRange () { |
|
1009
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_NumRange, "NumRange", "Types::Common::Numeric", "NumRange" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1010
|
|
|
|
|
|
|
} |
|
1011
|
|
|
|
|
|
|
|
|
1012
|
|
|
|
|
|
|
sub is_NumRange ($) { |
|
1013
|
9
|
0
|
0
|
9
|
0
|
48
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
|
9
|
|
|
0
|
|
14
|
|
|
|
9
|
|
|
|
|
395
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1014
|
|
|
|
|
|
|
} |
|
1015
|
|
|
|
|
|
|
|
|
1016
|
|
|
|
|
|
|
sub assert_NumRange ($) { |
|
1017
|
9
|
0
|
0
|
9
|
0
|
43
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) ? $_[0] : NumRange->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
14
|
|
|
|
9
|
|
|
|
|
1195
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1018
|
|
|
|
|
|
|
} |
|
1019
|
|
|
|
|
|
|
|
|
1020
|
|
|
|
|
|
|
$EXPORT_TAGS{"NumRange"} = [ qw( NumRange is_NumRange assert_NumRange ) ]; |
|
1021
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NumRange"} }; |
|
1022
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NumRange"; |
|
1023
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NumRange"; |
|
1024
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NumRange"; |
|
1025
|
|
|
|
|
|
|
|
|
1026
|
|
|
|
|
|
|
} |
|
1027
|
|
|
|
|
|
|
|
|
1028
|
|
|
|
|
|
|
# NumericCard |
|
1029
|
|
|
|
|
|
|
{ |
|
1030
|
|
|
|
|
|
|
my $type; |
|
1031
|
|
|
|
|
|
|
sub NumericCard () { |
|
1032
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_NumericCard, "NumericCard", "Acme::Mitey::Cards::Types::Source", "NumericCard" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1033
|
|
|
|
|
|
|
} |
|
1034
|
|
|
|
|
|
|
|
|
1035
|
|
|
|
|
|
|
sub is_NumericCard ($) { |
|
1036
|
9
|
0
|
|
9
|
0
|
45
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Numeric]) }) |
|
|
9
|
|
|
0
|
|
15
|
|
|
|
9
|
|
|
|
|
423
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1037
|
|
|
|
|
|
|
} |
|
1038
|
|
|
|
|
|
|
|
|
1039
|
|
|
|
|
|
|
sub assert_NumericCard ($) { |
|
1040
|
9
|
0
|
|
9
|
0
|
43
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Numeric]) }) ? $_[0] : NumericCard->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
12
|
|
|
|
9
|
|
|
|
|
4524
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1041
|
|
|
|
|
|
|
} |
|
1042
|
|
|
|
|
|
|
|
|
1043
|
|
|
|
|
|
|
$EXPORT_TAGS{"NumericCard"} = [ qw( NumericCard is_NumericCard assert_NumericCard ) ]; |
|
1044
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NumericCard"} }; |
|
1045
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NumericCard"; |
|
1046
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NumericCard"; |
|
1047
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NumericCard"; |
|
1048
|
|
|
|
|
|
|
|
|
1049
|
|
|
|
|
|
|
} |
|
1050
|
|
|
|
|
|
|
|
|
1051
|
|
|
|
|
|
|
# NumericCode |
|
1052
|
|
|
|
|
|
|
{ |
|
1053
|
|
|
|
|
|
|
my $type; |
|
1054
|
|
|
|
|
|
|
sub NumericCode () { |
|
1055
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_NumericCode, "NumericCode", "Types::Common::String", "NumericCode" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1056
|
|
|
|
|
|
|
} |
|
1057
|
|
|
|
|
|
|
|
|
1058
|
|
|
|
|
|
|
sub is_NumericCode ($) { |
|
1059
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && ($_[0] =~ m/^[0-9]+$/)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1060
|
|
|
|
|
|
|
} |
|
1061
|
|
|
|
|
|
|
|
|
1062
|
|
|
|
|
|
|
sub assert_NumericCode ($) { |
|
1063
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && ($_[0] =~ m/^[0-9]+$/)) ? $_[0] : NumericCode->get_message( $_[0] ); |
|
1064
|
|
|
|
|
|
|
} |
|
1065
|
|
|
|
|
|
|
|
|
1066
|
|
|
|
|
|
|
$EXPORT_TAGS{"NumericCode"} = [ qw( NumericCode is_NumericCode assert_NumericCode ) ]; |
|
1067
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NumericCode"} }; |
|
1068
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NumericCode"; |
|
1069
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NumericCode"; |
|
1070
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NumericCode"; |
|
1071
|
|
|
|
|
|
|
|
|
1072
|
|
|
|
|
|
|
} |
|
1073
|
|
|
|
|
|
|
|
|
1074
|
|
|
|
|
|
|
# Object |
|
1075
|
|
|
|
|
|
|
{ |
|
1076
|
|
|
|
|
|
|
my $type; |
|
1077
|
|
|
|
|
|
|
sub Object () { |
|
1078
|
3
|
|
50
|
3
|
0
|
28
|
$type ||= bless( [ \&is_Object, "Object", "Types::Standard", "Object" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1079
|
|
|
|
|
|
|
} |
|
1080
|
|
|
|
|
|
|
|
|
1081
|
|
|
|
|
|
|
sub is_Object ($) { |
|
1082
|
9
|
|
|
9
|
0
|
58
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) |
|
|
9
|
|
|
0
|
|
16
|
|
|
|
9
|
|
|
|
|
327
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1083
|
|
|
|
|
|
|
} |
|
1084
|
|
|
|
|
|
|
|
|
1085
|
|
|
|
|
|
|
sub assert_Object ($) { |
|
1086
|
9
|
0
|
|
9
|
0
|
38
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) ? $_[0] : Object->get_message( $_[0] ); |
|
|
9
|
|
|
0
|
|
22
|
|
|
|
9
|
|
|
|
|
1359
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1087
|
|
|
|
|
|
|
} |
|
1088
|
|
|
|
|
|
|
|
|
1089
|
|
|
|
|
|
|
$EXPORT_TAGS{"Object"} = [ qw( Object is_Object assert_Object ) ]; |
|
1090
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Object"} }; |
|
1091
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Object"; |
|
1092
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Object"; |
|
1093
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Object"; |
|
1094
|
|
|
|
|
|
|
|
|
1095
|
|
|
|
|
|
|
} |
|
1096
|
|
|
|
|
|
|
|
|
1097
|
|
|
|
|
|
|
# OptList |
|
1098
|
|
|
|
|
|
|
{ |
|
1099
|
|
|
|
|
|
|
my $type; |
|
1100
|
|
|
|
|
|
|
sub OptList () { |
|
1101
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_OptList, "OptList", "Types::Standard", "OptList" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1102
|
|
|
|
|
|
|
} |
|
1103
|
|
|
|
|
|
|
|
|
1104
|
|
|
|
|
|
|
sub is_OptList ($) { |
|
1105
|
9
|
0
|
0
|
9
|
0
|
50
|
(((ref($_[0]) eq 'ARRAY')) && (do { my $ok = 1; for my $inner (@{$_[0]}) { no warnings; ($ok=0) && last unless ref($inner) eq q(ARRAY) && @$inner == 2 && (do { defined($inner->[0]) and do { ref(\$inner->[0]) eq 'SCALAR' or ref(\(my $val = $inner->[0])) eq 'SCALAR' } }); } $ok })) |
|
|
9
|
0
|
0
|
0
|
|
13
|
|
|
|
9
|
0
|
0
|
|
|
1092
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1106
|
|
|
|
|
|
|
} |
|
1107
|
|
|
|
|
|
|
|
|
1108
|
|
|
|
|
|
|
sub assert_OptList ($) { |
|
1109
|
9
|
0
|
0
|
9
|
0
|
48
|
(((ref($_[0]) eq 'ARRAY')) && (do { my $ok = 1; for my $inner (@{$_[0]}) { no warnings; ($ok=0) && last unless ref($inner) eq q(ARRAY) && @$inner == 2 && (do { defined($inner->[0]) and do { ref(\$inner->[0]) eq 'SCALAR' or ref(\(my $val = $inner->[0])) eq 'SCALAR' } }); } $ok })) ? $_[0] : OptList->get_message( $_[0] ); |
|
|
9
|
|
|
0
|
|
17
|
|
|
|
9
|
|
|
|
|
2790
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1110
|
|
|
|
|
|
|
} |
|
1111
|
|
|
|
|
|
|
|
|
1112
|
|
|
|
|
|
|
$EXPORT_TAGS{"OptList"} = [ qw( OptList is_OptList assert_OptList ) ]; |
|
1113
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"OptList"} }; |
|
1114
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "OptList"; |
|
1115
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_OptList"; |
|
1116
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_OptList"; |
|
1117
|
|
|
|
|
|
|
|
|
1118
|
|
|
|
|
|
|
} |
|
1119
|
|
|
|
|
|
|
|
|
1120
|
|
|
|
|
|
|
# Optional |
|
1121
|
|
|
|
|
|
|
{ |
|
1122
|
|
|
|
|
|
|
my $type; |
|
1123
|
|
|
|
|
|
|
sub Optional () { |
|
1124
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Optional, "Optional", "Types::Standard", "Optional" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1125
|
|
|
|
|
|
|
} |
|
1126
|
|
|
|
|
|
|
|
|
1127
|
|
|
|
|
|
|
sub is_Optional ($) { |
|
1128
|
0
|
|
|
0
|
0
|
0
|
(!!1) |
|
1129
|
|
|
|
|
|
|
} |
|
1130
|
|
|
|
|
|
|
|
|
1131
|
|
|
|
|
|
|
sub assert_Optional ($) { |
|
1132
|
0
|
|
|
0
|
0
|
0
|
(!!1) ? $_[0] : Optional->get_message( $_[0] ); |
|
1133
|
|
|
|
|
|
|
} |
|
1134
|
|
|
|
|
|
|
|
|
1135
|
|
|
|
|
|
|
$EXPORT_TAGS{"Optional"} = [ qw( Optional is_Optional assert_Optional ) ]; |
|
1136
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Optional"} }; |
|
1137
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Optional"; |
|
1138
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Optional"; |
|
1139
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Optional"; |
|
1140
|
|
|
|
|
|
|
|
|
1141
|
|
|
|
|
|
|
} |
|
1142
|
|
|
|
|
|
|
|
|
1143
|
|
|
|
|
|
|
# Overload |
|
1144
|
|
|
|
|
|
|
{ |
|
1145
|
|
|
|
|
|
|
my $type; |
|
1146
|
|
|
|
|
|
|
sub Overload () { |
|
1147
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Overload, "Overload", "Types::Standard", "Overload" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1148
|
|
|
|
|
|
|
} |
|
1149
|
|
|
|
|
|
|
|
|
1150
|
|
|
|
|
|
|
sub is_Overload ($) { |
|
1151
|
9
|
0
|
|
9
|
0
|
52
|
(do { use Scalar::Util (); use overload (); Scalar::Util::blessed($_[0]) and overload::Overloaded($_[0]) }) |
|
|
9
|
|
|
9
|
|
15
|
|
|
|
9
|
|
|
0
|
|
100
|
|
|
|
9
|
|
|
|
|
39
|
|
|
|
9
|
|
|
|
|
11
|
|
|
|
9
|
|
|
|
|
399
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1152
|
|
|
|
|
|
|
} |
|
1153
|
|
|
|
|
|
|
|
|
1154
|
|
|
|
|
|
|
sub assert_Overload ($) { |
|
1155
|
9
|
0
|
|
9
|
0
|
38
|
(do { use Scalar::Util (); use overload (); Scalar::Util::blessed($_[0]) and overload::Overloaded($_[0]) }) ? $_[0] : Overload->get_message( $_[0] ); |
|
|
9
|
0
|
|
9
|
|
16
|
|
|
|
9
|
|
|
0
|
|
94
|
|
|
|
9
|
|
|
|
|
32
|
|
|
|
9
|
|
|
|
|
14
|
|
|
|
9
|
|
|
|
|
5348
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1156
|
|
|
|
|
|
|
} |
|
1157
|
|
|
|
|
|
|
|
|
1158
|
|
|
|
|
|
|
$EXPORT_TAGS{"Overload"} = [ qw( Overload is_Overload assert_Overload ) ]; |
|
1159
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Overload"} }; |
|
1160
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Overload"; |
|
1161
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Overload"; |
|
1162
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Overload"; |
|
1163
|
|
|
|
|
|
|
|
|
1164
|
|
|
|
|
|
|
} |
|
1165
|
|
|
|
|
|
|
|
|
1166
|
|
|
|
|
|
|
# Password |
|
1167
|
|
|
|
|
|
|
{ |
|
1168
|
|
|
|
|
|
|
my $type; |
|
1169
|
|
|
|
|
|
|
sub Password () { |
|
1170
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Password, "Password", "Types::Common::String", "Password" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1171
|
|
|
|
|
|
|
} |
|
1172
|
|
|
|
|
|
|
|
|
1173
|
|
|
|
|
|
|
sub is_Password ($) { |
|
1174
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 3)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1175
|
|
|
|
|
|
|
} |
|
1176
|
|
|
|
|
|
|
|
|
1177
|
|
|
|
|
|
|
sub assert_Password ($) { |
|
1178
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 3)) ? $_[0] : Password->get_message( $_[0] ); |
|
1179
|
|
|
|
|
|
|
} |
|
1180
|
|
|
|
|
|
|
|
|
1181
|
|
|
|
|
|
|
$EXPORT_TAGS{"Password"} = [ qw( Password is_Password assert_Password ) ]; |
|
1182
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Password"} }; |
|
1183
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Password"; |
|
1184
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Password"; |
|
1185
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Password"; |
|
1186
|
|
|
|
|
|
|
|
|
1187
|
|
|
|
|
|
|
} |
|
1188
|
|
|
|
|
|
|
|
|
1189
|
|
|
|
|
|
|
# PositiveInt |
|
1190
|
|
|
|
|
|
|
{ |
|
1191
|
|
|
|
|
|
|
my $type; |
|
1192
|
|
|
|
|
|
|
sub PositiveInt () { |
|
1193
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_PositiveInt, "PositiveInt", "Types::Common::Numeric", "PositiveInt" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1194
|
|
|
|
|
|
|
} |
|
1195
|
|
|
|
|
|
|
|
|
1196
|
|
|
|
|
|
|
sub is_PositiveInt ($) { |
|
1197
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] > 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1198
|
|
|
|
|
|
|
} |
|
1199
|
|
|
|
|
|
|
|
|
1200
|
|
|
|
|
|
|
sub assert_PositiveInt ($) { |
|
1201
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] > 0)) ? $_[0] : PositiveInt->get_message( $_[0] ); |
|
1202
|
|
|
|
|
|
|
} |
|
1203
|
|
|
|
|
|
|
|
|
1204
|
|
|
|
|
|
|
$EXPORT_TAGS{"PositiveInt"} = [ qw( PositiveInt is_PositiveInt assert_PositiveInt ) ]; |
|
1205
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"PositiveInt"} }; |
|
1206
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "PositiveInt"; |
|
1207
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_PositiveInt"; |
|
1208
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_PositiveInt"; |
|
1209
|
|
|
|
|
|
|
|
|
1210
|
|
|
|
|
|
|
} |
|
1211
|
|
|
|
|
|
|
|
|
1212
|
|
|
|
|
|
|
# PositiveNum |
|
1213
|
|
|
|
|
|
|
{ |
|
1214
|
|
|
|
|
|
|
my $type; |
|
1215
|
|
|
|
|
|
|
sub PositiveNum () { |
|
1216
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_PositiveNum, "PositiveNum", "Types::Common::Numeric", "PositiveNum" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1217
|
|
|
|
|
|
|
} |
|
1218
|
|
|
|
|
|
|
|
|
1219
|
|
|
|
|
|
|
sub is_PositiveNum ($) { |
|
1220
|
9
|
0
|
0
|
9
|
0
|
55
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] > 0)) |
|
|
9
|
0
|
|
0
|
|
15
|
|
|
|
9
|
|
|
|
|
486
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1221
|
|
|
|
|
|
|
} |
|
1222
|
|
|
|
|
|
|
|
|
1223
|
|
|
|
|
|
|
sub assert_PositiveNum ($) { |
|
1224
|
9
|
0
|
0
|
9
|
0
|
42
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] > 0)) ? $_[0] : PositiveNum->get_message( $_[0] ); |
|
|
9
|
|
|
0
|
|
13
|
|
|
|
9
|
|
|
|
|
3227
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1225
|
|
|
|
|
|
|
} |
|
1226
|
|
|
|
|
|
|
|
|
1227
|
|
|
|
|
|
|
$EXPORT_TAGS{"PositiveNum"} = [ qw( PositiveNum is_PositiveNum assert_PositiveNum ) ]; |
|
1228
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"PositiveNum"} }; |
|
1229
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "PositiveNum"; |
|
1230
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_PositiveNum"; |
|
1231
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_PositiveNum"; |
|
1232
|
|
|
|
|
|
|
|
|
1233
|
|
|
|
|
|
|
} |
|
1234
|
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
# PositiveOrZeroInt |
|
1236
|
|
|
|
|
|
|
{ |
|
1237
|
|
|
|
|
|
|
my $type; |
|
1238
|
|
|
|
|
|
|
sub PositiveOrZeroInt () { |
|
1239
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_PositiveOrZeroInt, "PositiveOrZeroInt", "Types::Common::Numeric", "PositiveOrZeroInt" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1240
|
|
|
|
|
|
|
} |
|
1241
|
|
|
|
|
|
|
|
|
1242
|
|
|
|
|
|
|
sub is_PositiveOrZeroInt ($) { |
|
1243
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1244
|
|
|
|
|
|
|
} |
|
1245
|
|
|
|
|
|
|
|
|
1246
|
|
|
|
|
|
|
sub assert_PositiveOrZeroInt ($) { |
|
1247
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= 0)) ? $_[0] : PositiveOrZeroInt->get_message( $_[0] ); |
|
1248
|
|
|
|
|
|
|
} |
|
1249
|
|
|
|
|
|
|
|
|
1250
|
|
|
|
|
|
|
$EXPORT_TAGS{"PositiveOrZeroInt"} = [ qw( PositiveOrZeroInt is_PositiveOrZeroInt assert_PositiveOrZeroInt ) ]; |
|
1251
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"PositiveOrZeroInt"} }; |
|
1252
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "PositiveOrZeroInt"; |
|
1253
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_PositiveOrZeroInt"; |
|
1254
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_PositiveOrZeroInt"; |
|
1255
|
|
|
|
|
|
|
|
|
1256
|
|
|
|
|
|
|
} |
|
1257
|
|
|
|
|
|
|
|
|
1258
|
|
|
|
|
|
|
# PositiveOrZeroNum |
|
1259
|
|
|
|
|
|
|
{ |
|
1260
|
|
|
|
|
|
|
my $type; |
|
1261
|
|
|
|
|
|
|
sub PositiveOrZeroNum () { |
|
1262
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_PositiveOrZeroNum, "PositiveOrZeroNum", "Types::Common::Numeric", "PositiveOrZeroNum" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1263
|
|
|
|
|
|
|
} |
|
1264
|
|
|
|
|
|
|
|
|
1265
|
|
|
|
|
|
|
sub is_PositiveOrZeroNum ($) { |
|
1266
|
9
|
0
|
0
|
9
|
0
|
50
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] >= 0)) |
|
|
9
|
0
|
|
0
|
|
21
|
|
|
|
9
|
|
|
|
|
476
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1267
|
|
|
|
|
|
|
} |
|
1268
|
|
|
|
|
|
|
|
|
1269
|
|
|
|
|
|
|
sub assert_PositiveOrZeroNum ($) { |
|
1270
|
9
|
0
|
0
|
9
|
0
|
41
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] >= 0)) ? $_[0] : PositiveOrZeroNum->get_message( $_[0] ); |
|
|
9
|
|
|
0
|
|
14
|
|
|
|
9
|
|
|
|
|
2609
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1271
|
|
|
|
|
|
|
} |
|
1272
|
|
|
|
|
|
|
|
|
1273
|
|
|
|
|
|
|
$EXPORT_TAGS{"PositiveOrZeroNum"} = [ qw( PositiveOrZeroNum is_PositiveOrZeroNum assert_PositiveOrZeroNum ) ]; |
|
1274
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"PositiveOrZeroNum"} }; |
|
1275
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "PositiveOrZeroNum"; |
|
1276
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_PositiveOrZeroNum"; |
|
1277
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_PositiveOrZeroNum"; |
|
1278
|
|
|
|
|
|
|
|
|
1279
|
|
|
|
|
|
|
} |
|
1280
|
|
|
|
|
|
|
|
|
1281
|
|
|
|
|
|
|
# Ref |
|
1282
|
|
|
|
|
|
|
{ |
|
1283
|
|
|
|
|
|
|
my $type; |
|
1284
|
|
|
|
|
|
|
sub Ref () { |
|
1285
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Ref, "Ref", "Types::Standard", "Ref" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1286
|
|
|
|
|
|
|
} |
|
1287
|
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
sub is_Ref ($) { |
|
1289
|
0
|
|
|
0
|
0
|
0
|
(!!ref($_[0])) |
|
1290
|
|
|
|
|
|
|
} |
|
1291
|
|
|
|
|
|
|
|
|
1292
|
|
|
|
|
|
|
sub assert_Ref ($) { |
|
1293
|
0
|
0
|
|
0
|
0
|
0
|
(!!ref($_[0])) ? $_[0] : Ref->get_message( $_[0] ); |
|
1294
|
|
|
|
|
|
|
} |
|
1295
|
|
|
|
|
|
|
|
|
1296
|
|
|
|
|
|
|
$EXPORT_TAGS{"Ref"} = [ qw( Ref is_Ref assert_Ref ) ]; |
|
1297
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Ref"} }; |
|
1298
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Ref"; |
|
1299
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Ref"; |
|
1300
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Ref"; |
|
1301
|
|
|
|
|
|
|
|
|
1302
|
|
|
|
|
|
|
} |
|
1303
|
|
|
|
|
|
|
|
|
1304
|
|
|
|
|
|
|
# RegexpRef |
|
1305
|
|
|
|
|
|
|
{ |
|
1306
|
|
|
|
|
|
|
my $type; |
|
1307
|
|
|
|
|
|
|
sub RegexpRef () { |
|
1308
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_RegexpRef, "RegexpRef", "Types::Standard", "RegexpRef" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1309
|
|
|
|
|
|
|
} |
|
1310
|
|
|
|
|
|
|
|
|
1311
|
|
|
|
|
|
|
sub is_RegexpRef ($) { |
|
1312
|
9
|
0
|
0
|
9
|
0
|
55
|
(do { use Scalar::Util (); use re (); ref($_[0]) && !!re::is_regexp($_[0]) or Scalar::Util::blessed($_[0]) && $_[0]->isa('Regexp') }) |
|
|
9
|
|
0
|
9
|
|
15
|
|
|
|
9
|
|
|
0
|
|
111
|
|
|
|
9
|
|
|
|
|
36
|
|
|
|
9
|
|
|
|
|
12
|
|
|
|
9
|
|
|
|
|
519
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1313
|
|
|
|
|
|
|
} |
|
1314
|
|
|
|
|
|
|
|
|
1315
|
|
|
|
|
|
|
sub assert_RegexpRef ($) { |
|
1316
|
9
|
0
|
0
|
9
|
0
|
44
|
(do { use Scalar::Util (); use re (); ref($_[0]) && !!re::is_regexp($_[0]) or Scalar::Util::blessed($_[0]) && $_[0]->isa('Regexp') }) ? $_[0] : RegexpRef->get_message( $_[0] ); |
|
|
9
|
0
|
0
|
9
|
|
13
|
|
|
|
9
|
|
|
0
|
|
96
|
|
|
|
9
|
|
|
|
|
44
|
|
|
|
9
|
|
|
|
|
12
|
|
|
|
9
|
|
|
|
|
1427
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1317
|
|
|
|
|
|
|
} |
|
1318
|
|
|
|
|
|
|
|
|
1319
|
|
|
|
|
|
|
$EXPORT_TAGS{"RegexpRef"} = [ qw( RegexpRef is_RegexpRef assert_RegexpRef ) ]; |
|
1320
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"RegexpRef"} }; |
|
1321
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "RegexpRef"; |
|
1322
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_RegexpRef"; |
|
1323
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_RegexpRef"; |
|
1324
|
|
|
|
|
|
|
|
|
1325
|
|
|
|
|
|
|
} |
|
1326
|
|
|
|
|
|
|
|
|
1327
|
|
|
|
|
|
|
# RoleName |
|
1328
|
|
|
|
|
|
|
{ |
|
1329
|
|
|
|
|
|
|
my $type; |
|
1330
|
|
|
|
|
|
|
sub RoleName () { |
|
1331
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_RoleName, "RoleName", "Types::Standard", "RoleName" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1332
|
|
|
|
|
|
|
} |
|
1333
|
|
|
|
|
|
|
|
|
1334
|
|
|
|
|
|
|
sub is_RoleName ($) { |
|
1335
|
0
|
|
|
0
|
0
|
0
|
do { (sub { |
|
1336
|
9
|
|
|
9
|
|
46
|
no strict 'refs'; |
|
|
9
|
|
|
|
|
15
|
|
|
|
9
|
|
|
|
|
1891
|
|
|
1337
|
0
|
0
|
|
0
|
|
0
|
return !!0 if ref $_[0]; |
|
1338
|
0
|
0
|
|
|
|
0
|
return !!0 if not $_[0]; |
|
1339
|
0
|
0
|
|
|
|
0
|
return !!0 if ref(do { my $tmpstr = $_[0]; \$tmpstr }) ne 'SCALAR'; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1340
|
0
|
|
|
|
|
0
|
my $stash = \%{"$_[0]\::"}; |
|
|
0
|
|
|
|
|
0
|
|
|
1341
|
0
|
0
|
0
|
|
|
0
|
return !!1 if exists($stash->{'ISA'}) && *{$stash->{'ISA'}}{ARRAY} && @{$_[0].'::ISA'}; |
|
|
0
|
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1342
|
0
|
0
|
|
|
|
0
|
return !!1 if exists($stash->{'VERSION'}); |
|
1343
|
0
|
|
|
|
|
0
|
foreach my $globref (values %$stash) { |
|
1344
|
|
|
|
|
|
|
return !!1 |
|
1345
|
|
|
|
|
|
|
if ref \$globref eq 'GLOB' |
|
1346
|
0
|
|
|
|
|
0
|
? *{$globref}{CODE} |
|
1347
|
0
|
0
|
|
|
|
0
|
: ref $globref; # const or sub ref |
|
|
|
0
|
|
|
|
|
|
|
1348
|
|
|
|
|
|
|
} |
|
1349
|
0
|
|
|
|
|
0
|
return !!0; |
|
1350
|
0
|
0
|
|
|
|
0
|
})->(do { my $tmp = $_[0] }) and not $_[0]->can('new') } |
|
|
0
|
|
|
|
|
0
|
|
|
1351
|
|
|
|
|
|
|
} |
|
1352
|
|
|
|
|
|
|
|
|
1353
|
|
|
|
|
|
|
sub assert_RoleName ($) { |
|
1354
|
0
|
0
|
|
0
|
0
|
0
|
do { (sub { |
|
1355
|
9
|
|
|
9
|
|
48
|
no strict 'refs'; |
|
|
9
|
|
|
|
|
13
|
|
|
|
9
|
|
|
|
|
3954
|
|
|
1356
|
0
|
0
|
|
0
|
|
0
|
return !!0 if ref $_[0]; |
|
1357
|
0
|
0
|
|
|
|
0
|
return !!0 if not $_[0]; |
|
1358
|
0
|
0
|
|
|
|
0
|
return !!0 if ref(do { my $tmpstr = $_[0]; \$tmpstr }) ne 'SCALAR'; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1359
|
0
|
|
|
|
|
0
|
my $stash = \%{"$_[0]\::"}; |
|
|
0
|
|
|
|
|
0
|
|
|
1360
|
0
|
0
|
0
|
|
|
0
|
return !!1 if exists($stash->{'ISA'}) && *{$stash->{'ISA'}}{ARRAY} && @{$_[0].'::ISA'}; |
|
|
0
|
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1361
|
0
|
0
|
|
|
|
0
|
return !!1 if exists($stash->{'VERSION'}); |
|
1362
|
0
|
|
|
|
|
0
|
foreach my $globref (values %$stash) { |
|
1363
|
|
|
|
|
|
|
return !!1 |
|
1364
|
|
|
|
|
|
|
if ref \$globref eq 'GLOB' |
|
1365
|
0
|
|
|
|
|
0
|
? *{$globref}{CODE} |
|
1366
|
0
|
0
|
|
|
|
0
|
: ref $globref; # const or sub ref |
|
|
|
0
|
|
|
|
|
|
|
1367
|
|
|
|
|
|
|
} |
|
1368
|
0
|
|
|
|
|
0
|
return !!0; |
|
1369
|
0
|
0
|
|
|
|
0
|
})->(do { my $tmp = $_[0] }) and not $_[0]->can('new') } ? $_[0] : RoleName->get_message( $_[0] ); |
|
|
0
|
|
|
|
|
0
|
|
|
1370
|
|
|
|
|
|
|
} |
|
1371
|
|
|
|
|
|
|
|
|
1372
|
|
|
|
|
|
|
$EXPORT_TAGS{"RoleName"} = [ qw( RoleName is_RoleName assert_RoleName ) ]; |
|
1373
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"RoleName"} }; |
|
1374
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "RoleName"; |
|
1375
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_RoleName"; |
|
1376
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_RoleName"; |
|
1377
|
|
|
|
|
|
|
|
|
1378
|
|
|
|
|
|
|
} |
|
1379
|
|
|
|
|
|
|
|
|
1380
|
|
|
|
|
|
|
# ScalarRef |
|
1381
|
|
|
|
|
|
|
{ |
|
1382
|
|
|
|
|
|
|
my $type; |
|
1383
|
|
|
|
|
|
|
sub ScalarRef () { |
|
1384
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_ScalarRef, "ScalarRef", "Types::Standard", "ScalarRef" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1385
|
|
|
|
|
|
|
} |
|
1386
|
|
|
|
|
|
|
|
|
1387
|
|
|
|
|
|
|
sub is_ScalarRef ($) { |
|
1388
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'SCALAR' or ref($_[0]) eq 'REF') |
|
1389
|
|
|
|
|
|
|
} |
|
1390
|
|
|
|
|
|
|
|
|
1391
|
|
|
|
|
|
|
sub assert_ScalarRef ($) { |
|
1392
|
0
|
0
|
0
|
0
|
0
|
0
|
(ref($_[0]) eq 'SCALAR' or ref($_[0]) eq 'REF') ? $_[0] : ScalarRef->get_message( $_[0] ); |
|
1393
|
|
|
|
|
|
|
} |
|
1394
|
|
|
|
|
|
|
|
|
1395
|
|
|
|
|
|
|
$EXPORT_TAGS{"ScalarRef"} = [ qw( ScalarRef is_ScalarRef assert_ScalarRef ) ]; |
|
1396
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"ScalarRef"} }; |
|
1397
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "ScalarRef"; |
|
1398
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_ScalarRef"; |
|
1399
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_ScalarRef"; |
|
1400
|
|
|
|
|
|
|
|
|
1401
|
|
|
|
|
|
|
} |
|
1402
|
|
|
|
|
|
|
|
|
1403
|
|
|
|
|
|
|
# Set |
|
1404
|
|
|
|
|
|
|
{ |
|
1405
|
|
|
|
|
|
|
my $type; |
|
1406
|
|
|
|
|
|
|
sub Set () { |
|
1407
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_Set, "Set", "Acme::Mitey::Cards::Types::Source", "Set" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1408
|
|
|
|
|
|
|
} |
|
1409
|
|
|
|
|
|
|
|
|
1410
|
|
|
|
|
|
|
sub is_Set ($) { |
|
1411
|
9
|
0
|
|
9
|
0
|
52
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Set]) }) |
|
|
9
|
|
|
0
|
|
12
|
|
|
|
9
|
|
|
|
|
530
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1412
|
|
|
|
|
|
|
} |
|
1413
|
|
|
|
|
|
|
|
|
1414
|
|
|
|
|
|
|
sub assert_Set ($) { |
|
1415
|
9
|
0
|
|
9
|
0
|
48
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Set]) }) ? $_[0] : Set->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
14
|
|
|
|
9
|
|
|
|
|
19644
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1416
|
|
|
|
|
|
|
} |
|
1417
|
|
|
|
|
|
|
|
|
1418
|
|
|
|
|
|
|
$EXPORT_TAGS{"Set"} = [ qw( Set is_Set assert_Set ) ]; |
|
1419
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Set"} }; |
|
1420
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Set"; |
|
1421
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Set"; |
|
1422
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Set"; |
|
1423
|
|
|
|
|
|
|
|
|
1424
|
|
|
|
|
|
|
} |
|
1425
|
|
|
|
|
|
|
|
|
1426
|
|
|
|
|
|
|
# SimpleStr |
|
1427
|
|
|
|
|
|
|
{ |
|
1428
|
|
|
|
|
|
|
my $type; |
|
1429
|
|
|
|
|
|
|
sub SimpleStr () { |
|
1430
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_SimpleStr, "SimpleStr", "Types::Common::String", "SimpleStr" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1431
|
|
|
|
|
|
|
} |
|
1432
|
|
|
|
|
|
|
|
|
1433
|
|
|
|
|
|
|
sub is_SimpleStr ($) { |
|
1434
|
0
|
0
|
0
|
0
|
0
|
0
|
((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1435
|
|
|
|
|
|
|
} |
|
1436
|
|
|
|
|
|
|
|
|
1437
|
|
|
|
|
|
|
sub assert_SimpleStr ($) { |
|
1438
|
0
|
0
|
0
|
0
|
0
|
0
|
((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) ? $_[0] : SimpleStr->get_message( $_[0] ); |
|
1439
|
|
|
|
|
|
|
} |
|
1440
|
|
|
|
|
|
|
|
|
1441
|
|
|
|
|
|
|
$EXPORT_TAGS{"SimpleStr"} = [ qw( SimpleStr is_SimpleStr assert_SimpleStr ) ]; |
|
1442
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"SimpleStr"} }; |
|
1443
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "SimpleStr"; |
|
1444
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_SimpleStr"; |
|
1445
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_SimpleStr"; |
|
1446
|
|
|
|
|
|
|
|
|
1447
|
|
|
|
|
|
|
} |
|
1448
|
|
|
|
|
|
|
|
|
1449
|
|
|
|
|
|
|
# SingleDigit |
|
1450
|
|
|
|
|
|
|
{ |
|
1451
|
|
|
|
|
|
|
my $type; |
|
1452
|
|
|
|
|
|
|
sub SingleDigit () { |
|
1453
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_SingleDigit, "SingleDigit", "Types::Common::Numeric", "SingleDigit" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1454
|
|
|
|
|
|
|
} |
|
1455
|
|
|
|
|
|
|
|
|
1456
|
|
|
|
|
|
|
sub is_SingleDigit ($) { |
|
1457
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= -9) && ($_[0] <= 9)) |
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1458
|
|
|
|
|
|
|
} |
|
1459
|
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
sub assert_SingleDigit ($) { |
|
1461
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= -9) && ($_[0] <= 9)) ? $_[0] : SingleDigit->get_message( $_[0] ); |
|
1462
|
|
|
|
|
|
|
} |
|
1463
|
|
|
|
|
|
|
|
|
1464
|
|
|
|
|
|
|
$EXPORT_TAGS{"SingleDigit"} = [ qw( SingleDigit is_SingleDigit assert_SingleDigit ) ]; |
|
1465
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"SingleDigit"} }; |
|
1466
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "SingleDigit"; |
|
1467
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_SingleDigit"; |
|
1468
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_SingleDigit"; |
|
1469
|
|
|
|
|
|
|
|
|
1470
|
|
|
|
|
|
|
} |
|
1471
|
|
|
|
|
|
|
|
|
1472
|
|
|
|
|
|
|
# Str |
|
1473
|
|
|
|
|
|
|
{ |
|
1474
|
|
|
|
|
|
|
my $type; |
|
1475
|
|
|
|
|
|
|
sub Str () { |
|
1476
|
21
|
|
100
|
21
|
0
|
85
|
$type ||= bless( [ \&is_Str, "Str", "Types::Standard", "Str" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1477
|
|
|
|
|
|
|
} |
|
1478
|
|
|
|
|
|
|
|
|
1479
|
|
|
|
|
|
|
sub is_Str ($) { |
|
1480
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1481
|
|
|
|
|
|
|
} |
|
1482
|
|
|
|
|
|
|
|
|
1483
|
|
|
|
|
|
|
sub assert_Str ($) { |
|
1484
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } ? $_[0] : Str->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1485
|
|
|
|
|
|
|
} |
|
1486
|
|
|
|
|
|
|
|
|
1487
|
|
|
|
|
|
|
$EXPORT_TAGS{"Str"} = [ qw( Str is_Str assert_Str ) ]; |
|
1488
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Str"} }; |
|
1489
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Str"; |
|
1490
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Str"; |
|
1491
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Str"; |
|
1492
|
|
|
|
|
|
|
|
|
1493
|
|
|
|
|
|
|
} |
|
1494
|
|
|
|
|
|
|
|
|
1495
|
|
|
|
|
|
|
# StrLength |
|
1496
|
|
|
|
|
|
|
{ |
|
1497
|
|
|
|
|
|
|
my $type; |
|
1498
|
|
|
|
|
|
|
sub StrLength () { |
|
1499
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_StrLength, "StrLength", "Types::Common::String", "StrLength" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1500
|
|
|
|
|
|
|
} |
|
1501
|
|
|
|
|
|
|
|
|
1502
|
|
|
|
|
|
|
sub is_StrLength ($) { |
|
1503
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1504
|
|
|
|
|
|
|
} |
|
1505
|
|
|
|
|
|
|
|
|
1506
|
|
|
|
|
|
|
sub assert_StrLength ($) { |
|
1507
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } ? $_[0] : StrLength->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1508
|
|
|
|
|
|
|
} |
|
1509
|
|
|
|
|
|
|
|
|
1510
|
|
|
|
|
|
|
$EXPORT_TAGS{"StrLength"} = [ qw( StrLength is_StrLength assert_StrLength ) ]; |
|
1511
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"StrLength"} }; |
|
1512
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "StrLength"; |
|
1513
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_StrLength"; |
|
1514
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_StrLength"; |
|
1515
|
|
|
|
|
|
|
|
|
1516
|
|
|
|
|
|
|
} |
|
1517
|
|
|
|
|
|
|
|
|
1518
|
|
|
|
|
|
|
# StrMatch |
|
1519
|
|
|
|
|
|
|
{ |
|
1520
|
|
|
|
|
|
|
my $type; |
|
1521
|
|
|
|
|
|
|
sub StrMatch () { |
|
1522
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_StrMatch, "StrMatch", "Types::Standard", "StrMatch" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1523
|
|
|
|
|
|
|
} |
|
1524
|
|
|
|
|
|
|
|
|
1525
|
|
|
|
|
|
|
sub is_StrMatch ($) { |
|
1526
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1527
|
|
|
|
|
|
|
} |
|
1528
|
|
|
|
|
|
|
|
|
1529
|
|
|
|
|
|
|
sub assert_StrMatch ($) { |
|
1530
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } ? $_[0] : StrMatch->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1531
|
|
|
|
|
|
|
} |
|
1532
|
|
|
|
|
|
|
|
|
1533
|
|
|
|
|
|
|
$EXPORT_TAGS{"StrMatch"} = [ qw( StrMatch is_StrMatch assert_StrMatch ) ]; |
|
1534
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"StrMatch"} }; |
|
1535
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "StrMatch"; |
|
1536
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_StrMatch"; |
|
1537
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_StrMatch"; |
|
1538
|
|
|
|
|
|
|
|
|
1539
|
|
|
|
|
|
|
} |
|
1540
|
|
|
|
|
|
|
|
|
1541
|
|
|
|
|
|
|
# StrictNum |
|
1542
|
|
|
|
|
|
|
{ |
|
1543
|
|
|
|
|
|
|
my $type; |
|
1544
|
|
|
|
|
|
|
sub StrictNum () { |
|
1545
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_StrictNum, "StrictNum", "Types::Standard", "StrictNum" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1546
|
|
|
|
|
|
|
} |
|
1547
|
|
|
|
|
|
|
|
|
1548
|
|
|
|
|
|
|
sub is_StrictNum ($) { |
|
1549
|
0
|
0
|
0
|
0
|
0
|
0
|
do { my $val = $_[0];(defined($val) and not ref($val)) && ( $val =~ /\A[+-]?[0-9]+\z/ || $val =~ /\A(?:[+-]?) # matches optional +- in the beginning |
|
|
0
|
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1550
|
|
|
|
|
|
|
(?=[0-9]|\.[0-9]) # matches previous +- only if there is something like 3 or .3 |
|
1551
|
|
|
|
|
|
|
[0-9]* # matches 0-9 zero or more times |
|
1552
|
|
|
|
|
|
|
(?:\.[0-9]+)? # matches optional .89 or nothing |
|
1553
|
|
|
|
|
|
|
(?:[Ee](?:[+-]?[0-9]+))? # matches E1 or e1 or e-1 or e+1 etc |
|
1554
|
|
|
|
|
|
|
\z/x ); } |
|
1555
|
|
|
|
|
|
|
} |
|
1556
|
|
|
|
|
|
|
|
|
1557
|
|
|
|
|
|
|
sub assert_StrictNum ($) { |
|
1558
|
0
|
0
|
0
|
0
|
0
|
0
|
do { my $val = $_[0];(defined($val) and not ref($val)) && ( $val =~ /\A[+-]?[0-9]+\z/ || $val =~ /\A(?:[+-]?) # matches optional +- in the beginning |
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1559
|
|
|
|
|
|
|
(?=[0-9]|\.[0-9]) # matches previous +- only if there is something like 3 or .3 |
|
1560
|
|
|
|
|
|
|
[0-9]* # matches 0-9 zero or more times |
|
1561
|
|
|
|
|
|
|
(?:\.[0-9]+)? # matches optional .89 or nothing |
|
1562
|
|
|
|
|
|
|
(?:[Ee](?:[+-]?[0-9]+))? # matches E1 or e1 or e-1 or e+1 etc |
|
1563
|
|
|
|
|
|
|
\z/x ); } ? $_[0] : StrictNum->get_message( $_[0] ); |
|
1564
|
|
|
|
|
|
|
} |
|
1565
|
|
|
|
|
|
|
|
|
1566
|
|
|
|
|
|
|
$EXPORT_TAGS{"StrictNum"} = [ qw( StrictNum is_StrictNum assert_StrictNum ) ]; |
|
1567
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"StrictNum"} }; |
|
1568
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "StrictNum"; |
|
1569
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_StrictNum"; |
|
1570
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_StrictNum"; |
|
1571
|
|
|
|
|
|
|
|
|
1572
|
|
|
|
|
|
|
} |
|
1573
|
|
|
|
|
|
|
|
|
1574
|
|
|
|
|
|
|
# StrongPassword |
|
1575
|
|
|
|
|
|
|
{ |
|
1576
|
|
|
|
|
|
|
my $type; |
|
1577
|
|
|
|
|
|
|
sub StrongPassword () { |
|
1578
|
0
|
|
0
|
0
|
0
|
0
|
$type ||= bless( [ \&is_StrongPassword, "StrongPassword", "Types::Common::String", "StrongPassword" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1579
|
|
|
|
|
|
|
} |
|
1580
|
|
|
|
|
|
|
|
|
1581
|
|
|
|
|
|
|
sub is_StrongPassword ($) { |
|
1582
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 7) && ($_[0] =~ /[^a-zA-Z]/)) |
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1583
|
|
|
|
|
|
|
} |
|
1584
|
|
|
|
|
|
|
|
|
1585
|
|
|
|
|
|
|
sub assert_StrongPassword ($) { |
|
1586
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 7) && ($_[0] =~ /[^a-zA-Z]/)) ? $_[0] : StrongPassword->get_message( $_[0] ); |
|
1587
|
|
|
|
|
|
|
} |
|
1588
|
|
|
|
|
|
|
|
|
1589
|
|
|
|
|
|
|
$EXPORT_TAGS{"StrongPassword"} = [ qw( StrongPassword is_StrongPassword assert_StrongPassword ) ]; |
|
1590
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"StrongPassword"} }; |
|
1591
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "StrongPassword"; |
|
1592
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_StrongPassword"; |
|
1593
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_StrongPassword"; |
|
1594
|
|
|
|
|
|
|
|
|
1595
|
|
|
|
|
|
|
} |
|
1596
|
|
|
|
|
|
|
|
|
1597
|
|
|
|
|
|
|
# Suit |
|
1598
|
|
|
|
|
|
|
{ |
|
1599
|
|
|
|
|
|
|
my $type; |
|
1600
|
|
|
|
|
|
|
sub Suit () { |
|
1601
|
6
|
|
100
|
6
|
0
|
40
|
$type ||= bless( [ \&is_Suit, "Suit", "Acme::Mitey::Cards::Types::Source", "Suit" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1602
|
|
|
|
|
|
|
} |
|
1603
|
|
|
|
|
|
|
|
|
1604
|
|
|
|
|
|
|
sub is_Suit ($) { |
|
1605
|
9
|
0
|
|
9
|
0
|
72
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Suit]) }) |
|
|
9
|
|
|
0
|
|
20
|
|
|
|
9
|
|
|
|
|
598
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1606
|
|
|
|
|
|
|
} |
|
1607
|
|
|
|
|
|
|
|
|
1608
|
|
|
|
|
|
|
sub assert_Suit ($) { |
|
1609
|
9
|
0
|
|
9
|
0
|
58
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Suit]) }) ? $_[0] : Suit->get_message( $_[0] ); |
|
|
9
|
0
|
|
0
|
|
16
|
|
|
|
9
|
|
|
|
|
1701
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1610
|
|
|
|
|
|
|
} |
|
1611
|
|
|
|
|
|
|
|
|
1612
|
|
|
|
|
|
|
$EXPORT_TAGS{"Suit"} = [ qw( Suit is_Suit assert_Suit ) ]; |
|
1613
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Suit"} }; |
|
1614
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Suit"; |
|
1615
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Suit"; |
|
1616
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Suit"; |
|
1617
|
|
|
|
|
|
|
|
|
1618
|
|
|
|
|
|
|
} |
|
1619
|
|
|
|
|
|
|
|
|
1620
|
|
|
|
|
|
|
# Tied |
|
1621
|
|
|
|
|
|
|
{ |
|
1622
|
|
|
|
|
|
|
my $type; |
|
1623
|
|
|
|
|
|
|
sub Tied () { |
|
1624
|
0
|
|
0
|
0
|
0
|
|
$type ||= bless( [ \&is_Tied, "Tied", "Types::Standard", "Tied" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1625
|
|
|
|
|
|
|
} |
|
1626
|
|
|
|
|
|
|
|
|
1627
|
|
|
|
|
|
|
sub is_Tied ($) { |
|
1628
|
9
|
|
0
|
9
|
0
|
63
|
(do { use Scalar::Util (); (!!ref($_[0])) and !!tied(Scalar::Util::reftype($_[0]) eq 'HASH' ? %{$_[0]} : Scalar::Util::reftype($_[0]) eq 'ARRAY' ? @{$_[0]} : Scalar::Util::reftype($_[0]) =~ /^(SCALAR|REF)$/ ? ${$_[0]} : undef) }) |
|
|
9
|
|
|
0
|
|
14
|
|
|
|
9
|
|
|
|
|
1282
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1629
|
|
|
|
|
|
|
} |
|
1630
|
|
|
|
|
|
|
|
|
1631
|
|
|
|
|
|
|
sub assert_Tied ($) { |
|
1632
|
9
|
0
|
0
|
9
|
0
|
55
|
(do { use Scalar::Util (); (!!ref($_[0])) and !!tied(Scalar::Util::reftype($_[0]) eq 'HASH' ? %{$_[0]} : Scalar::Util::reftype($_[0]) eq 'ARRAY' ? @{$_[0]} : Scalar::Util::reftype($_[0]) =~ /^(SCALAR|REF)$/ ? ${$_[0]} : undef) }) ? $_[0] : Tied->get_message( $_[0] ); |
|
|
9
|
|
|
0
|
|
15
|
|
|
|
9
|
|
|
|
|
6132
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1633
|
|
|
|
|
|
|
} |
|
1634
|
|
|
|
|
|
|
|
|
1635
|
|
|
|
|
|
|
$EXPORT_TAGS{"Tied"} = [ qw( Tied is_Tied assert_Tied ) ]; |
|
1636
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Tied"} }; |
|
1637
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Tied"; |
|
1638
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Tied"; |
|
1639
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Tied"; |
|
1640
|
|
|
|
|
|
|
|
|
1641
|
|
|
|
|
|
|
} |
|
1642
|
|
|
|
|
|
|
|
|
1643
|
|
|
|
|
|
|
# Tuple |
|
1644
|
|
|
|
|
|
|
{ |
|
1645
|
|
|
|
|
|
|
my $type; |
|
1646
|
|
|
|
|
|
|
sub Tuple () { |
|
1647
|
0
|
|
0
|
0
|
0
|
|
$type ||= bless( [ \&is_Tuple, "Tuple", "Types::Standard", "Tuple" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1648
|
|
|
|
|
|
|
} |
|
1649
|
|
|
|
|
|
|
|
|
1650
|
|
|
|
|
|
|
sub is_Tuple ($) { |
|
1651
|
0
|
|
|
0
|
0
|
|
(ref($_[0]) eq 'ARRAY') |
|
1652
|
|
|
|
|
|
|
} |
|
1653
|
|
|
|
|
|
|
|
|
1654
|
|
|
|
|
|
|
sub assert_Tuple ($) { |
|
1655
|
0
|
0
|
|
0
|
0
|
|
(ref($_[0]) eq 'ARRAY') ? $_[0] : Tuple->get_message( $_[0] ); |
|
1656
|
|
|
|
|
|
|
} |
|
1657
|
|
|
|
|
|
|
|
|
1658
|
|
|
|
|
|
|
$EXPORT_TAGS{"Tuple"} = [ qw( Tuple is_Tuple assert_Tuple ) ]; |
|
1659
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Tuple"} }; |
|
1660
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Tuple"; |
|
1661
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Tuple"; |
|
1662
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Tuple"; |
|
1663
|
|
|
|
|
|
|
|
|
1664
|
|
|
|
|
|
|
} |
|
1665
|
|
|
|
|
|
|
|
|
1666
|
|
|
|
|
|
|
# Undef |
|
1667
|
|
|
|
|
|
|
{ |
|
1668
|
|
|
|
|
|
|
my $type; |
|
1669
|
|
|
|
|
|
|
sub Undef () { |
|
1670
|
0
|
|
0
|
0
|
0
|
|
$type ||= bless( [ \&is_Undef, "Undef", "Types::Standard", "Undef" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1671
|
|
|
|
|
|
|
} |
|
1672
|
|
|
|
|
|
|
|
|
1673
|
|
|
|
|
|
|
sub is_Undef ($) { |
|
1674
|
0
|
|
|
0
|
0
|
|
(!defined($_[0])) |
|
1675
|
|
|
|
|
|
|
} |
|
1676
|
|
|
|
|
|
|
|
|
1677
|
|
|
|
|
|
|
sub assert_Undef ($) { |
|
1678
|
0
|
0
|
|
0
|
0
|
|
(!defined($_[0])) ? $_[0] : Undef->get_message( $_[0] ); |
|
1679
|
|
|
|
|
|
|
} |
|
1680
|
|
|
|
|
|
|
|
|
1681
|
|
|
|
|
|
|
$EXPORT_TAGS{"Undef"} = [ qw( Undef is_Undef assert_Undef ) ]; |
|
1682
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Undef"} }; |
|
1683
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Undef"; |
|
1684
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Undef"; |
|
1685
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Undef"; |
|
1686
|
|
|
|
|
|
|
|
|
1687
|
|
|
|
|
|
|
} |
|
1688
|
|
|
|
|
|
|
|
|
1689
|
|
|
|
|
|
|
# UpperCaseSimpleStr |
|
1690
|
|
|
|
|
|
|
{ |
|
1691
|
|
|
|
|
|
|
my $type; |
|
1692
|
|
|
|
|
|
|
sub UpperCaseSimpleStr () { |
|
1693
|
0
|
|
0
|
0
|
0
|
|
$type ||= bless( [ \&is_UpperCaseSimpleStr, "UpperCaseSimpleStr", "Types::Common::String", "UpperCaseSimpleStr" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1694
|
|
|
|
|
|
|
} |
|
1695
|
|
|
|
|
|
|
|
|
1696
|
|
|
|
|
|
|
sub is_UpperCaseSimpleStr ($) { |
|
1697
|
0
|
0
|
0
|
0
|
0
|
|
(do { (do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Lower}/ms }) |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1698
|
|
|
|
|
|
|
} |
|
1699
|
|
|
|
|
|
|
|
|
1700
|
|
|
|
|
|
|
sub assert_UpperCaseSimpleStr ($) { |
|
1701
|
0
|
0
|
0
|
0
|
0
|
|
(do { (do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Lower}/ms }) ? $_[0] : UpperCaseSimpleStr->get_message( $_[0] ); |
|
1702
|
|
|
|
|
|
|
} |
|
1703
|
|
|
|
|
|
|
|
|
1704
|
|
|
|
|
|
|
$EXPORT_TAGS{"UpperCaseSimpleStr"} = [ qw( UpperCaseSimpleStr is_UpperCaseSimpleStr assert_UpperCaseSimpleStr ) ]; |
|
1705
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"UpperCaseSimpleStr"} }; |
|
1706
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "UpperCaseSimpleStr"; |
|
1707
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_UpperCaseSimpleStr"; |
|
1708
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_UpperCaseSimpleStr"; |
|
1709
|
|
|
|
|
|
|
|
|
1710
|
|
|
|
|
|
|
} |
|
1711
|
|
|
|
|
|
|
|
|
1712
|
|
|
|
|
|
|
# UpperCaseStr |
|
1713
|
|
|
|
|
|
|
{ |
|
1714
|
|
|
|
|
|
|
my $type; |
|
1715
|
|
|
|
|
|
|
sub UpperCaseStr () { |
|
1716
|
0
|
|
0
|
0
|
0
|
|
$type ||= bless( [ \&is_UpperCaseStr, "UpperCaseStr", "Types::Common::String", "UpperCaseStr" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1717
|
|
|
|
|
|
|
} |
|
1718
|
|
|
|
|
|
|
|
|
1719
|
|
|
|
|
|
|
sub is_UpperCaseStr ($) { |
|
1720
|
0
|
0
|
|
0
|
0
|
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Lower}/ms }) |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1721
|
|
|
|
|
|
|
} |
|
1722
|
|
|
|
|
|
|
|
|
1723
|
|
|
|
|
|
|
sub assert_UpperCaseStr ($) { |
|
1724
|
0
|
0
|
0
|
0
|
0
|
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Lower}/ms }) ? $_[0] : UpperCaseStr->get_message( $_[0] ); |
|
1725
|
|
|
|
|
|
|
} |
|
1726
|
|
|
|
|
|
|
|
|
1727
|
|
|
|
|
|
|
$EXPORT_TAGS{"UpperCaseStr"} = [ qw( UpperCaseStr is_UpperCaseStr assert_UpperCaseStr ) ]; |
|
1728
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"UpperCaseStr"} }; |
|
1729
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "UpperCaseStr"; |
|
1730
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_UpperCaseStr"; |
|
1731
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_UpperCaseStr"; |
|
1732
|
|
|
|
|
|
|
|
|
1733
|
|
|
|
|
|
|
} |
|
1734
|
|
|
|
|
|
|
|
|
1735
|
|
|
|
|
|
|
# Value |
|
1736
|
|
|
|
|
|
|
{ |
|
1737
|
|
|
|
|
|
|
my $type; |
|
1738
|
|
|
|
|
|
|
sub Value () { |
|
1739
|
0
|
|
0
|
0
|
0
|
|
$type ||= bless( [ \&is_Value, "Value", "Types::Standard", "Value" ], "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1740
|
|
|
|
|
|
|
} |
|
1741
|
|
|
|
|
|
|
|
|
1742
|
|
|
|
|
|
|
sub is_Value ($) { |
|
1743
|
0
|
0
|
|
0
|
0
|
|
(defined($_[0]) and not ref($_[0])) |
|
1744
|
|
|
|
|
|
|
} |
|
1745
|
|
|
|
|
|
|
|
|
1746
|
|
|
|
|
|
|
sub assert_Value ($) { |
|
1747
|
0
|
0
|
0
|
0
|
0
|
|
(defined($_[0]) and not ref($_[0])) ? $_[0] : Value->get_message( $_[0] ); |
|
1748
|
|
|
|
|
|
|
} |
|
1749
|
|
|
|
|
|
|
|
|
1750
|
|
|
|
|
|
|
$EXPORT_TAGS{"Value"} = [ qw( Value is_Value assert_Value ) ]; |
|
1751
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Value"} }; |
|
1752
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Value"; |
|
1753
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Value"; |
|
1754
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Value"; |
|
1755
|
|
|
|
|
|
|
|
|
1756
|
|
|
|
|
|
|
} |
|
1757
|
|
|
|
|
|
|
|
|
1758
|
|
|
|
|
|
|
|
|
1759
|
|
|
|
|
|
|
1; |
|
1760
|
|
|
|
|
|
|
__END__ |