line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Mite::Attribute; |
4
|
79
|
|
|
79
|
|
613
|
use strict; |
|
79
|
|
|
|
|
227
|
|
|
79
|
|
|
|
|
2777
|
|
5
|
79
|
|
|
79
|
|
549
|
use warnings; |
|
79
|
|
|
|
|
212
|
|
|
79
|
|
|
|
|
2670
|
|
6
|
79
|
|
|
79
|
|
433
|
no warnings qw( once void ); |
|
79
|
|
|
|
|
225
|
|
|
79
|
|
|
|
|
11077
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
9
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
10
|
|
|
|
|
|
|
our $MITE_VERSION = "0.011000"; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Mite keywords |
13
|
|
|
|
|
|
|
BEGIN { |
14
|
79
|
|
|
79
|
|
537
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "Mite::Attribute" ); |
15
|
|
|
|
|
|
|
( |
16
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
17
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
18
|
|
|
|
|
|
|
) |
19
|
79
|
|
|
|
|
229
|
= do { |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package Mite::Shim; |
22
|
79
|
|
|
79
|
|
595
|
no warnings 'redefine'; |
|
79
|
|
|
|
|
204
|
|
|
79
|
|
|
|
|
15388
|
|
23
|
|
|
|
|
|
|
( |
24
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
25
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
26
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
27
|
|
|
|
0
|
|
|
sub { }, |
28
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
29
|
2291
|
|
|
2291
|
|
2107342
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
30
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
31
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
32
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
33
|
79
|
|
|
|
|
12149
|
); |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Mite imports |
38
|
|
|
|
|
|
|
BEGIN { |
39
|
79
|
|
|
79
|
|
594
|
require Scalar::Util; |
40
|
79
|
|
|
|
|
290
|
*STRICT = \&Mite::Shim::STRICT; |
41
|
79
|
|
|
|
|
251
|
*bare = \&Mite::Shim::bare; |
42
|
79
|
|
|
|
|
363
|
*blessed = \&Scalar::Util::blessed; |
43
|
79
|
|
|
|
|
246
|
*carp = \&Mite::Shim::carp; |
44
|
79
|
|
|
|
|
203
|
*confess = \&Mite::Shim::confess; |
45
|
79
|
|
|
|
|
190
|
*croak = \&Mite::Shim::croak; |
46
|
79
|
|
|
|
|
181
|
*false = \&Mite::Shim::false; |
47
|
79
|
|
|
|
|
199
|
*guard = \&Mite::Shim::guard; |
48
|
79
|
|
|
|
|
204
|
*lock = \&Mite::Shim::lock; |
49
|
79
|
|
|
|
|
174
|
*ro = \&Mite::Shim::ro; |
50
|
79
|
|
|
|
|
175
|
*rw = \&Mite::Shim::rw; |
51
|
79
|
|
|
|
|
200
|
*rwp = \&Mite::Shim::rwp; |
52
|
79
|
|
|
|
|
176
|
*true = \&Mite::Shim::true; |
53
|
79
|
|
|
|
|
2267
|
*unlock = \&Mite::Shim::unlock; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
57
|
|
|
|
|
|
|
sub __META__ { |
58
|
79
|
|
|
79
|
|
456
|
no strict 'refs'; |
|
79
|
|
|
|
|
237
|
|
|
79
|
|
|
|
|
244118
|
|
59
|
73
|
|
|
73
|
|
218
|
my $class = shift; |
60
|
73
|
|
33
|
|
|
604
|
$class = ref($class) || $class; |
61
|
73
|
|
|
|
|
742
|
my $linear_isa = mro::get_linear_isa($class); |
62
|
|
|
|
|
|
|
return { |
63
|
|
|
|
|
|
|
BUILD => [ |
64
|
73
|
50
|
|
|
|
212
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
73
|
|
|
|
|
888
|
|
|
73
|
|
|
|
|
523
|
|
65
|
73
|
|
|
|
|
454
|
map { "$_\::BUILD" } reverse @$linear_isa |
66
|
|
|
|
|
|
|
], |
67
|
|
|
|
|
|
|
DEMOLISH => [ |
68
|
73
|
50
|
|
|
|
185
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
73
|
|
|
|
|
2156
|
|
|
0
|
|
|
|
|
0
|
|
69
|
73
|
|
|
|
|
396
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
73
|
|
|
|
|
434
|
|
70
|
|
|
|
|
|
|
], |
71
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
72
|
|
|
|
|
|
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
73
|
|
|
|
|
|
|
}; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
77
|
|
|
|
|
|
|
sub new { |
78
|
174
|
50
|
|
174
|
0
|
73836
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
79
|
174
|
|
66
|
|
|
1326
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
80
|
174
|
|
|
|
|
641
|
my $self = bless {}, $class; |
81
|
|
|
|
|
|
|
my $args = |
82
|
|
|
|
|
|
|
$meta->{HAS_BUILDARGS} |
83
|
|
|
|
|
|
|
? $class->BUILDARGS(@_) |
84
|
174
|
50
|
|
|
|
1562
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
85
|
174
|
|
|
|
|
487
|
my $no_build = delete $args->{__no_BUILD__}; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
# Attribute _order |
88
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 18 |
89
|
174
|
|
|
|
|
1132
|
$self->{"_order"} = $self->_build__order; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
# Attribute definition_context (type: HashRef) |
92
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 20 |
93
|
174
|
|
|
|
|
401
|
do { |
94
|
|
|
|
|
|
|
my $value = |
95
|
|
|
|
|
|
|
exists( $args->{"definition_context"} ) |
96
|
174
|
100
|
|
|
|
705
|
? $args->{"definition_context"} |
97
|
|
|
|
|
|
|
: {}; |
98
|
174
|
50
|
|
|
|
734
|
( ref($value) eq 'HASH' ) |
99
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
100
|
|
|
|
|
|
|
"definition_context", "HashRef"; |
101
|
174
|
|
|
|
|
536
|
$self->{"definition_context"} = $value; |
102
|
|
|
|
|
|
|
}; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
# Attribute class (type: Mite::Package) |
105
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 25 |
106
|
174
|
100
|
|
|
|
634
|
if ( exists $args->{"class"} ) { |
107
|
|
|
|
|
|
|
blessed( $args->{"class"} ) |
108
|
112
|
50
|
33
|
|
|
2898
|
&& $args->{"class"}->isa("Mite::Package") |
109
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
110
|
|
|
|
|
|
|
"class", "Mite::Package"; |
111
|
112
|
|
|
|
|
470
|
$self->{"class"} = $args->{"class"}; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $self->{"class"} ) |
114
|
174
|
100
|
33
|
|
|
1664
|
if ref $self->{"class"}; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
# Attribute _class_for_default (type: Mite::Package) |
117
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 41 |
118
|
174
|
100
|
|
|
|
687
|
if ( exists $args->{"_class_for_default"} ) { |
119
|
|
|
|
|
|
|
blessed( $args->{"_class_for_default"} ) |
120
|
2
|
50
|
33
|
|
|
76
|
&& $args->{"_class_for_default"}->isa("Mite::Package") |
121
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
122
|
|
|
|
|
|
|
"_class_for_default", "Mite::Package"; |
123
|
2
|
|
|
|
|
18
|
$self->{"_class_for_default"} = $args->{"_class_for_default"}; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
require Scalar::Util |
126
|
|
|
|
|
|
|
&& Scalar::Util::weaken( $self->{"_class_for_default"} ) |
127
|
174
|
100
|
33
|
|
|
651
|
if ref $self->{"_class_for_default"}; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
# Attribute name (type: NonEmptyStr) |
130
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 43 |
131
|
174
|
50
|
|
|
|
944
|
croak "Missing key in constructor: name" unless exists $args->{"name"}; |
132
|
|
|
|
|
|
|
( |
133
|
|
|
|
|
|
|
( |
134
|
|
|
|
|
|
|
do { |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
package Mite::Shim; |
137
|
174
|
50
|
|
|
|
991
|
defined( $args->{"name"} ) and do { |
138
|
|
|
|
|
|
|
ref( \$args->{"name"} ) eq 'SCALAR' |
139
|
174
|
50
|
|
|
|
1582
|
or ref( \( my $val = $args->{"name"} ) ) eq 'SCALAR'; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
} |
142
|
174
|
50
|
33
|
|
|
331
|
) && do { package Mite::Shim; length( $args->{"name"} ) > 0 } |
|
174
|
|
|
|
|
867
|
|
143
|
|
|
|
|
|
|
) |
144
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", "name", |
145
|
|
|
|
|
|
|
"NonEmptyStr"; |
146
|
174
|
|
|
|
|
671
|
$self->{"name"} = $args->{"name"}; |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
# Attribute init_arg (type: NonEmptyStr|Undef) |
149
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 52 |
150
|
174
|
100
|
|
|
|
849
|
if ( exists $args->{"init_arg"} ) { |
151
|
6
|
50
|
|
|
|
13
|
do { |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
package Mite::Shim; |
154
|
|
|
|
|
|
|
( |
155
|
|
|
|
|
|
|
( |
156
|
|
|
|
|
|
|
( |
157
|
|
|
|
|
|
|
do { |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
package Mite::Shim; |
160
|
6
|
100
|
|
|
|
62
|
defined( $args->{"init_arg"} ) and do { |
161
|
|
|
|
|
|
|
ref( \$args->{"init_arg"} ) eq 'SCALAR' |
162
|
|
|
|
|
|
|
or |
163
|
3
|
50
|
|
|
|
39
|
ref( \( my $val = $args->{"init_arg"} ) ) |
164
|
|
|
|
|
|
|
eq 'SCALAR'; |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
) |
168
|
|
|
|
|
|
|
&& do { |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
package Mite::Shim; |
171
|
3
|
|
|
|
|
32
|
length( $args->{"init_arg"} ) > 0; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
) |
174
|
|
|
|
|
|
|
or |
175
|
6
|
100
|
66
|
|
|
12
|
do { package Mite::Shim; !defined( $args->{"init_arg"} ) } |
|
3
|
|
|
|
|
28
|
|
176
|
|
|
|
|
|
|
); |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
179
|
|
|
|
|
|
|
"init_arg", "NonEmptyStr|Undef"; |
180
|
6
|
|
|
|
|
20
|
$self->{"init_arg"} = $args->{"init_arg"}; |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
# Attribute required (type: Bool) |
184
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 54 |
185
|
174
|
|
|
|
|
360
|
do { |
186
|
|
|
|
|
|
|
my $value = exists( $args->{"required"} ) |
187
|
174
|
100
|
|
|
|
751
|
? do { |
188
|
14
|
|
|
|
|
39
|
my $coerced_value = do { |
189
|
14
|
|
|
|
|
71
|
my $to_coerce = $args->{"required"}; |
190
|
|
|
|
|
|
|
( |
191
|
|
|
|
|
|
|
( |
192
|
|
|
|
|
|
|
!ref $to_coerce |
193
|
|
|
|
|
|
|
and (!defined $to_coerce |
194
|
|
|
|
|
|
|
or $to_coerce eq q() |
195
|
|
|
|
|
|
|
or $to_coerce eq '0' |
196
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
197
|
|
|
|
|
|
|
) |
198
|
|
|
|
|
|
|
) ? $to_coerce |
199
|
|
|
|
|
|
|
: ( ( !!1 ) ) |
200
|
14
|
50
|
33
|
|
|
228
|
? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
201
|
|
|
|
|
|
|
: $to_coerce; |
202
|
|
|
|
|
|
|
}; |
203
|
|
|
|
|
|
|
( |
204
|
|
|
|
|
|
|
( |
205
|
14
|
50
|
33
|
|
|
218
|
!ref $coerced_value |
206
|
|
|
|
|
|
|
and (!defined $coerced_value |
207
|
|
|
|
|
|
|
or $coerced_value eq q() |
208
|
|
|
|
|
|
|
or $coerced_value eq '0' |
209
|
|
|
|
|
|
|
or $coerced_value eq '1' ) |
210
|
|
|
|
|
|
|
) |
211
|
|
|
|
|
|
|
) |
212
|
|
|
|
|
|
|
? $coerced_value |
213
|
|
|
|
|
|
|
: croak( "Type check failed in constructor: %s should be %s", |
214
|
|
|
|
|
|
|
"required", "Bool" ); |
215
|
|
|
|
|
|
|
} |
216
|
|
|
|
|
|
|
: false; |
217
|
174
|
|
|
|
|
592
|
$self->{"required"} = $value; |
218
|
|
|
|
|
|
|
}; |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
# Attribute weak_ref (type: Bool) |
221
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 61 |
222
|
174
|
|
|
|
|
338
|
do { |
223
|
|
|
|
|
|
|
my $value = |
224
|
174
|
100
|
|
|
|
763
|
exists( $args->{"weak_ref"} ) ? $args->{"weak_ref"} : false; |
225
|
|
|
|
|
|
|
( |
226
|
174
|
50
|
66
|
|
|
1879
|
!ref $value |
|
|
|
66
|
|
|
|
|
227
|
|
|
|
|
|
|
and (!defined $value |
228
|
|
|
|
|
|
|
or $value eq q() |
229
|
|
|
|
|
|
|
or $value eq '0' |
230
|
|
|
|
|
|
|
or $value eq '1' ) |
231
|
|
|
|
|
|
|
) |
232
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
233
|
|
|
|
|
|
|
"weak_ref", "Bool"; |
234
|
174
|
|
|
|
|
603
|
$self->{"weak_ref"} = $value; |
235
|
|
|
|
|
|
|
}; |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
# Attribute is (type: Enum["ro","rw","rwp","lazy","bare","locked"]) |
238
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 66 |
239
|
174
|
|
|
|
|
320
|
do { |
240
|
174
|
100
|
|
|
|
760
|
my $value = exists( $args->{"is"} ) ? $args->{"is"} : "bare"; |
241
|
174
|
100
|
|
|
|
341
|
do { |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
package Mite::Shim; |
244
|
174
|
50
|
33
|
|
|
2489
|
( defined($value) |
245
|
|
|
|
|
|
|
and !ref($value) |
246
|
|
|
|
|
|
|
and $value =~ |
247
|
|
|
|
|
|
|
m{\A(?:(?:bare|l(?:azy|ocked)|r(?:wp?|o)))\z} ); |
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
250
|
|
|
|
|
|
|
"is", "Enum[\"ro\",\"rw\",\"rwp\",\"lazy\",\"bare\",\"locked\"]"; |
251
|
173
|
|
|
|
|
675
|
$self->{"is"} = $value; |
252
|
|
|
|
|
|
|
}; |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
# Attribute reader (type: MethodNameTemplate|One|Undef) |
255
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
256
|
173
|
100
|
|
|
|
706
|
if ( exists $args->{"reader"} ) { |
257
|
10
|
50
|
|
|
|
32
|
do { |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
package Mite::Shim; |
260
|
|
|
|
|
|
|
( |
261
|
|
|
|
|
|
|
do { |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
package Mite::Shim; |
264
|
|
|
|
|
|
|
( |
265
|
|
|
|
|
|
|
( |
266
|
|
|
|
|
|
|
( |
267
|
|
|
|
|
|
|
do { |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
package Mite::Shim; |
270
|
10
|
100
|
|
|
|
118
|
defined( $args->{"reader"} ) and do { |
271
|
|
|
|
|
|
|
ref( \$args->{"reader"} ) eq |
272
|
|
|
|
|
|
|
'SCALAR' |
273
|
|
|
|
|
|
|
or ref( |
274
|
|
|
|
|
|
|
\( |
275
|
8
|
50
|
|
|
|
144
|
my $val = $args->{"reader"} |
276
|
|
|
|
|
|
|
) |
277
|
|
|
|
|
|
|
) eq 'SCALAR'; |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
} |
280
|
|
|
|
|
|
|
) |
281
|
|
|
|
|
|
|
&& ( |
282
|
|
|
|
|
|
|
do { |
283
|
8
|
|
|
|
|
38
|
local $_ = $args->{"reader"}; |
284
|
8
|
|
|
|
|
103
|
/\A[^\W0-9]\w*\z/; |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
) |
287
|
|
|
|
|
|
|
) |
288
|
|
|
|
|
|
|
or ( |
289
|
|
|
|
|
|
|
( |
290
|
|
|
|
|
|
|
do { |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
package Mite::Shim; |
293
|
10
|
100
|
|
|
|
122
|
defined( $args->{"reader"} ) and do { |
294
|
|
|
|
|
|
|
ref( \$args->{"reader"} ) eq |
295
|
|
|
|
|
|
|
'SCALAR' |
296
|
|
|
|
|
|
|
or ref( |
297
|
|
|
|
|
|
|
\( |
298
|
8
|
50
|
|
|
|
76
|
my $val = $args->{"reader"} |
299
|
|
|
|
|
|
|
) |
300
|
|
|
|
|
|
|
) eq 'SCALAR'; |
301
|
|
|
|
|
|
|
} |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
) |
304
|
|
|
|
|
|
|
&& ( |
305
|
10
|
50
|
100
|
|
|
27
|
do { local $_ = $args->{"reader"}; /\%/ } |
|
8
|
|
66
|
|
|
32
|
|
|
8
|
|
|
|
|
95
|
|
306
|
|
|
|
|
|
|
) |
307
|
|
|
|
|
|
|
) |
308
|
|
|
|
|
|
|
); |
309
|
|
|
|
|
|
|
} |
310
|
|
|
|
|
|
|
or do { |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
package Mite::Shim; |
313
|
|
|
|
|
|
|
( defined( $args->{"reader"} ) |
314
|
|
|
|
|
|
|
and !ref( $args->{"reader"} ) |
315
|
5
|
100
|
66
|
|
|
64
|
and $args->{"reader"} =~ m{\A(?:1)\z} ); |
316
|
|
|
|
|
|
|
} |
317
|
|
|
|
|
|
|
or |
318
|
10
|
100
|
100
|
|
|
30
|
do { package Mite::Shim; !defined( $args->{"reader"} ) } |
|
2
|
|
|
|
|
10
|
|
319
|
|
|
|
|
|
|
); |
320
|
|
|
|
|
|
|
} |
321
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
322
|
|
|
|
|
|
|
"reader", "MethodNameTemplate|One|Undef"; |
323
|
10
|
|
|
|
|
54
|
$self->{"reader"} = $args->{"reader"}; |
324
|
|
|
|
|
|
|
} |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
# Attribute writer (type: MethodNameTemplate|One|Undef) |
327
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
328
|
173
|
100
|
|
|
|
638
|
if ( exists $args->{"writer"} ) { |
329
|
11
|
50
|
|
|
|
34
|
do { |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
package Mite::Shim; |
332
|
|
|
|
|
|
|
( |
333
|
|
|
|
|
|
|
do { |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
package Mite::Shim; |
336
|
|
|
|
|
|
|
( |
337
|
|
|
|
|
|
|
( |
338
|
|
|
|
|
|
|
( |
339
|
|
|
|
|
|
|
do { |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
package Mite::Shim; |
342
|
11
|
100
|
|
|
|
114
|
defined( $args->{"writer"} ) and do { |
343
|
|
|
|
|
|
|
ref( \$args->{"writer"} ) eq |
344
|
|
|
|
|
|
|
'SCALAR' |
345
|
|
|
|
|
|
|
or ref( |
346
|
|
|
|
|
|
|
\( |
347
|
4
|
50
|
|
|
|
94
|
my $val = $args->{"writer"} |
348
|
|
|
|
|
|
|
) |
349
|
|
|
|
|
|
|
) eq 'SCALAR'; |
350
|
|
|
|
|
|
|
} |
351
|
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
) |
353
|
|
|
|
|
|
|
&& ( |
354
|
|
|
|
|
|
|
do { |
355
|
4
|
|
|
|
|
20
|
local $_ = $args->{"writer"}; |
356
|
4
|
|
|
|
|
53
|
/\A[^\W0-9]\w*\z/; |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
) |
359
|
|
|
|
|
|
|
) |
360
|
|
|
|
|
|
|
or ( |
361
|
|
|
|
|
|
|
( |
362
|
|
|
|
|
|
|
do { |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
package Mite::Shim; |
365
|
11
|
100
|
|
|
|
120
|
defined( $args->{"writer"} ) and do { |
366
|
|
|
|
|
|
|
ref( \$args->{"writer"} ) eq |
367
|
|
|
|
|
|
|
'SCALAR' |
368
|
|
|
|
|
|
|
or ref( |
369
|
|
|
|
|
|
|
\( |
370
|
4
|
50
|
|
|
|
28
|
my $val = $args->{"writer"} |
371
|
|
|
|
|
|
|
) |
372
|
|
|
|
|
|
|
) eq 'SCALAR'; |
373
|
|
|
|
|
|
|
} |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
) |
376
|
|
|
|
|
|
|
&& ( |
377
|
11
|
50
|
66
|
|
|
27
|
do { local $_ = $args->{"writer"}; /\%/ } |
|
4
|
|
66
|
|
|
11
|
|
|
4
|
|
|
|
|
43
|
|
378
|
|
|
|
|
|
|
) |
379
|
|
|
|
|
|
|
) |
380
|
|
|
|
|
|
|
); |
381
|
|
|
|
|
|
|
} |
382
|
|
|
|
|
|
|
or do { |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
package Mite::Shim; |
385
|
|
|
|
|
|
|
( defined( $args->{"writer"} ) |
386
|
|
|
|
|
|
|
and !ref( $args->{"writer"} ) |
387
|
11
|
100
|
66
|
|
|
154
|
and $args->{"writer"} =~ m{\A(?:1)\z} ); |
388
|
|
|
|
|
|
|
} |
389
|
|
|
|
|
|
|
or |
390
|
11
|
100
|
66
|
|
|
46
|
do { package Mite::Shim; !defined( $args->{"writer"} ) } |
|
7
|
|
|
|
|
44
|
|
391
|
|
|
|
|
|
|
); |
392
|
|
|
|
|
|
|
} |
393
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
394
|
|
|
|
|
|
|
"writer", "MethodNameTemplate|One|Undef"; |
395
|
11
|
|
|
|
|
44
|
$self->{"writer"} = $args->{"writer"}; |
396
|
|
|
|
|
|
|
} |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
# Attribute accessor (type: MethodNameTemplate|One|Undef) |
399
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
400
|
173
|
100
|
|
|
|
669
|
if ( exists $args->{"accessor"} ) { |
401
|
11
|
50
|
|
|
|
26
|
do { |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
package Mite::Shim; |
404
|
|
|
|
|
|
|
( |
405
|
|
|
|
|
|
|
do { |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
package Mite::Shim; |
408
|
|
|
|
|
|
|
( |
409
|
|
|
|
|
|
|
( |
410
|
|
|
|
|
|
|
( |
411
|
|
|
|
|
|
|
do { |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
package Mite::Shim; |
414
|
11
|
100
|
|
|
|
115
|
defined( $args->{"accessor"} ) and do { |
415
|
|
|
|
|
|
|
ref( \$args->{"accessor"} ) eq |
416
|
|
|
|
|
|
|
'SCALAR' |
417
|
|
|
|
|
|
|
or ref( |
418
|
|
|
|
|
|
|
\( |
419
|
|
|
|
|
|
|
my $val = |
420
|
6
|
50
|
|
|
|
102
|
$args->{"accessor"} |
421
|
|
|
|
|
|
|
) |
422
|
|
|
|
|
|
|
) eq 'SCALAR'; |
423
|
|
|
|
|
|
|
} |
424
|
|
|
|
|
|
|
} |
425
|
|
|
|
|
|
|
) |
426
|
|
|
|
|
|
|
&& ( |
427
|
|
|
|
|
|
|
do { |
428
|
6
|
|
|
|
|
30
|
local $_ = $args->{"accessor"}; |
429
|
6
|
|
|
|
|
59
|
/\A[^\W0-9]\w*\z/; |
430
|
|
|
|
|
|
|
} |
431
|
|
|
|
|
|
|
) |
432
|
|
|
|
|
|
|
) |
433
|
|
|
|
|
|
|
or ( |
434
|
|
|
|
|
|
|
( |
435
|
|
|
|
|
|
|
do { |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
package Mite::Shim; |
438
|
11
|
100
|
|
|
|
116
|
defined( $args->{"accessor"} ) and do { |
439
|
|
|
|
|
|
|
ref( \$args->{"accessor"} ) eq |
440
|
|
|
|
|
|
|
'SCALAR' |
441
|
|
|
|
|
|
|
or ref( |
442
|
|
|
|
|
|
|
\( |
443
|
|
|
|
|
|
|
my $val = |
444
|
6
|
50
|
|
|
|
89
|
$args->{"accessor"} |
445
|
|
|
|
|
|
|
) |
446
|
|
|
|
|
|
|
) eq 'SCALAR'; |
447
|
|
|
|
|
|
|
} |
448
|
|
|
|
|
|
|
} |
449
|
|
|
|
|
|
|
) |
450
|
|
|
|
|
|
|
&& ( |
451
|
11
|
50
|
100
|
|
|
26
|
do { local $_ = $args->{"accessor"}; /\%/ } |
|
6
|
|
66
|
|
|
16
|
|
|
6
|
|
|
|
|
82
|
|
452
|
|
|
|
|
|
|
) |
453
|
|
|
|
|
|
|
) |
454
|
|
|
|
|
|
|
); |
455
|
|
|
|
|
|
|
} |
456
|
|
|
|
|
|
|
or do { |
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
package Mite::Shim; |
459
|
|
|
|
|
|
|
( defined( $args->{"accessor"} ) |
460
|
|
|
|
|
|
|
and !ref( $args->{"accessor"} ) |
461
|
9
|
100
|
66
|
|
|
178
|
and $args->{"accessor"} =~ m{\A(?:1)\z} ); |
462
|
|
|
|
|
|
|
} |
463
|
|
|
|
|
|
|
or |
464
|
11
|
100
|
100
|
|
|
34
|
do { package Mite::Shim; !defined( $args->{"accessor"} ) } |
|
5
|
|
|
|
|
38
|
|
465
|
|
|
|
|
|
|
); |
466
|
|
|
|
|
|
|
} |
467
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
468
|
|
|
|
|
|
|
"accessor", "MethodNameTemplate|One|Undef"; |
469
|
11
|
|
|
|
|
42
|
$self->{"accessor"} = $args->{"accessor"}; |
470
|
|
|
|
|
|
|
} |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
# Attribute clearer (type: MethodNameTemplate|One|Undef) |
473
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
474
|
173
|
100
|
|
|
|
689
|
if ( exists $args->{"clearer"} ) { |
475
|
10
|
50
|
|
|
|
22
|
do { |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
package Mite::Shim; |
478
|
|
|
|
|
|
|
( |
479
|
|
|
|
|
|
|
do { |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
package Mite::Shim; |
482
|
|
|
|
|
|
|
( |
483
|
|
|
|
|
|
|
( |
484
|
|
|
|
|
|
|
( |
485
|
|
|
|
|
|
|
do { |
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
package Mite::Shim; |
488
|
10
|
100
|
|
|
|
124
|
defined( $args->{"clearer"} ) and do { |
489
|
|
|
|
|
|
|
ref( \$args->{"clearer"} ) eq |
490
|
|
|
|
|
|
|
'SCALAR' |
491
|
|
|
|
|
|
|
or ref( |
492
|
|
|
|
|
|
|
\( |
493
|
3
|
50
|
|
|
|
53
|
my $val = $args->{"clearer"} |
494
|
|
|
|
|
|
|
) |
495
|
|
|
|
|
|
|
) eq 'SCALAR'; |
496
|
|
|
|
|
|
|
} |
497
|
|
|
|
|
|
|
} |
498
|
|
|
|
|
|
|
) |
499
|
|
|
|
|
|
|
&& ( |
500
|
|
|
|
|
|
|
do { |
501
|
3
|
|
|
|
|
15
|
local $_ = $args->{"clearer"}; |
502
|
3
|
|
|
|
|
43
|
/\A[^\W0-9]\w*\z/; |
503
|
|
|
|
|
|
|
} |
504
|
|
|
|
|
|
|
) |
505
|
|
|
|
|
|
|
) |
506
|
|
|
|
|
|
|
or ( |
507
|
|
|
|
|
|
|
( |
508
|
|
|
|
|
|
|
do { |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
package Mite::Shim; |
511
|
10
|
100
|
|
|
|
135
|
defined( $args->{"clearer"} ) and do { |
512
|
|
|
|
|
|
|
ref( \$args->{"clearer"} ) eq |
513
|
|
|
|
|
|
|
'SCALAR' |
514
|
|
|
|
|
|
|
or ref( |
515
|
|
|
|
|
|
|
\( |
516
|
3
|
50
|
|
|
|
22
|
my $val = $args->{"clearer"} |
517
|
|
|
|
|
|
|
) |
518
|
|
|
|
|
|
|
) eq 'SCALAR'; |
519
|
|
|
|
|
|
|
} |
520
|
|
|
|
|
|
|
} |
521
|
|
|
|
|
|
|
) |
522
|
|
|
|
|
|
|
&& ( |
523
|
10
|
50
|
66
|
|
|
28
|
do { local $_ = $args->{"clearer"}; /\%/ } |
|
3
|
|
66
|
|
|
7
|
|
|
3
|
|
|
|
|
40
|
|
524
|
|
|
|
|
|
|
) |
525
|
|
|
|
|
|
|
) |
526
|
|
|
|
|
|
|
); |
527
|
|
|
|
|
|
|
} |
528
|
|
|
|
|
|
|
or do { |
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
package Mite::Shim; |
531
|
|
|
|
|
|
|
( defined( $args->{"clearer"} ) |
532
|
|
|
|
|
|
|
and !ref( $args->{"clearer"} ) |
533
|
10
|
100
|
66
|
|
|
230
|
and $args->{"clearer"} =~ m{\A(?:1)\z} ); |
534
|
|
|
|
|
|
|
} |
535
|
|
|
|
|
|
|
or |
536
|
10
|
100
|
66
|
|
|
36
|
do { package Mite::Shim; !defined( $args->{"clearer"} ) } |
|
7
|
|
|
|
|
43
|
|
537
|
|
|
|
|
|
|
); |
538
|
|
|
|
|
|
|
} |
539
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
540
|
|
|
|
|
|
|
"clearer", "MethodNameTemplate|One|Undef"; |
541
|
10
|
|
|
|
|
35
|
$self->{"clearer"} = $args->{"clearer"}; |
542
|
|
|
|
|
|
|
} |
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
# Attribute predicate (type: MethodNameTemplate|One|Undef) |
545
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
546
|
173
|
100
|
|
|
|
715
|
if ( exists $args->{"predicate"} ) { |
547
|
10
|
50
|
|
|
|
37
|
do { |
548
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
package Mite::Shim; |
550
|
|
|
|
|
|
|
( |
551
|
|
|
|
|
|
|
do { |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
package Mite::Shim; |
554
|
|
|
|
|
|
|
( |
555
|
|
|
|
|
|
|
( |
556
|
|
|
|
|
|
|
( |
557
|
|
|
|
|
|
|
do { |
558
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
package Mite::Shim; |
560
|
10
|
100
|
|
|
|
104
|
defined( $args->{"predicate"} ) and do { |
561
|
|
|
|
|
|
|
ref( \$args->{"predicate"} ) eq |
562
|
|
|
|
|
|
|
'SCALAR' |
563
|
|
|
|
|
|
|
or ref( |
564
|
|
|
|
|
|
|
\( |
565
|
|
|
|
|
|
|
my $val = |
566
|
4
|
50
|
|
|
|
69
|
$args->{"predicate"} |
567
|
|
|
|
|
|
|
) |
568
|
|
|
|
|
|
|
) eq 'SCALAR'; |
569
|
|
|
|
|
|
|
} |
570
|
|
|
|
|
|
|
} |
571
|
|
|
|
|
|
|
) |
572
|
|
|
|
|
|
|
&& ( |
573
|
|
|
|
|
|
|
do { |
574
|
4
|
|
|
|
|
17
|
local $_ = $args->{"predicate"}; |
575
|
4
|
|
|
|
|
28
|
/\A[^\W0-9]\w*\z/; |
576
|
|
|
|
|
|
|
} |
577
|
|
|
|
|
|
|
) |
578
|
|
|
|
|
|
|
) |
579
|
|
|
|
|
|
|
or ( |
580
|
|
|
|
|
|
|
( |
581
|
|
|
|
|
|
|
do { |
582
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
package Mite::Shim; |
584
|
10
|
100
|
|
|
|
108
|
defined( $args->{"predicate"} ) and do { |
585
|
|
|
|
|
|
|
ref( \$args->{"predicate"} ) eq |
586
|
|
|
|
|
|
|
'SCALAR' |
587
|
|
|
|
|
|
|
or ref( |
588
|
|
|
|
|
|
|
\( |
589
|
|
|
|
|
|
|
my $val = |
590
|
4
|
50
|
|
|
|
61
|
$args->{"predicate"} |
591
|
|
|
|
|
|
|
) |
592
|
|
|
|
|
|
|
) eq 'SCALAR'; |
593
|
|
|
|
|
|
|
} |
594
|
|
|
|
|
|
|
} |
595
|
|
|
|
|
|
|
) |
596
|
|
|
|
|
|
|
&& ( |
597
|
10
|
50
|
66
|
|
|
29
|
do { local $_ = $args->{"predicate"}; /\%/ } |
|
4
|
|
66
|
|
|
14
|
|
|
4
|
|
|
|
|
67
|
|
598
|
|
|
|
|
|
|
) |
599
|
|
|
|
|
|
|
) |
600
|
|
|
|
|
|
|
); |
601
|
|
|
|
|
|
|
} |
602
|
|
|
|
|
|
|
or do { |
603
|
|
|
|
|
|
|
|
604
|
|
|
|
|
|
|
package Mite::Shim; |
605
|
|
|
|
|
|
|
( defined( $args->{"predicate"} ) |
606
|
|
|
|
|
|
|
and !ref( $args->{"predicate"} ) |
607
|
10
|
100
|
66
|
|
|
165
|
and $args->{"predicate"} =~ m{\A(?:1)\z} ); |
608
|
|
|
|
|
|
|
} |
609
|
10
|
100
|
66
|
|
|
22
|
or do { |
610
|
|
|
|
|
|
|
|
611
|
|
|
|
|
|
|
package Mite::Shim; |
612
|
6
|
|
|
|
|
29
|
!defined( $args->{"predicate"} ); |
613
|
|
|
|
|
|
|
} |
614
|
|
|
|
|
|
|
); |
615
|
|
|
|
|
|
|
} |
616
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
617
|
|
|
|
|
|
|
"predicate", "MethodNameTemplate|One|Undef"; |
618
|
10
|
|
|
|
|
39
|
$self->{"predicate"} = $args->{"predicate"}; |
619
|
|
|
|
|
|
|
} |
620
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
# Attribute lvalue (type: MethodNameTemplate|One|Undef) |
622
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
623
|
173
|
100
|
|
|
|
655
|
if ( exists $args->{"lvalue"} ) { |
624
|
16
|
50
|
|
|
|
28
|
do { |
625
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
package Mite::Shim; |
627
|
|
|
|
|
|
|
( |
628
|
|
|
|
|
|
|
do { |
629
|
|
|
|
|
|
|
|
630
|
|
|
|
|
|
|
package Mite::Shim; |
631
|
|
|
|
|
|
|
( |
632
|
|
|
|
|
|
|
( |
633
|
|
|
|
|
|
|
( |
634
|
|
|
|
|
|
|
do { |
635
|
|
|
|
|
|
|
|
636
|
|
|
|
|
|
|
package Mite::Shim; |
637
|
16
|
100
|
|
|
|
121
|
defined( $args->{"lvalue"} ) and do { |
638
|
|
|
|
|
|
|
ref( \$args->{"lvalue"} ) eq |
639
|
|
|
|
|
|
|
'SCALAR' |
640
|
|
|
|
|
|
|
or ref( |
641
|
|
|
|
|
|
|
\( |
642
|
9
|
50
|
|
|
|
91
|
my $val = $args->{"lvalue"} |
643
|
|
|
|
|
|
|
) |
644
|
|
|
|
|
|
|
) eq 'SCALAR'; |
645
|
|
|
|
|
|
|
} |
646
|
|
|
|
|
|
|
} |
647
|
|
|
|
|
|
|
) |
648
|
|
|
|
|
|
|
&& ( |
649
|
|
|
|
|
|
|
do { |
650
|
9
|
|
|
|
|
30
|
local $_ = $args->{"lvalue"}; |
651
|
9
|
|
|
|
|
52
|
/\A[^\W0-9]\w*\z/; |
652
|
|
|
|
|
|
|
} |
653
|
|
|
|
|
|
|
) |
654
|
|
|
|
|
|
|
) |
655
|
|
|
|
|
|
|
or ( |
656
|
|
|
|
|
|
|
( |
657
|
|
|
|
|
|
|
do { |
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
package Mite::Shim; |
660
|
16
|
100
|
|
|
|
150
|
defined( $args->{"lvalue"} ) and do { |
661
|
|
|
|
|
|
|
ref( \$args->{"lvalue"} ) eq |
662
|
|
|
|
|
|
|
'SCALAR' |
663
|
|
|
|
|
|
|
or ref( |
664
|
|
|
|
|
|
|
\( |
665
|
9
|
50
|
|
|
|
52
|
my $val = $args->{"lvalue"} |
666
|
|
|
|
|
|
|
) |
667
|
|
|
|
|
|
|
) eq 'SCALAR'; |
668
|
|
|
|
|
|
|
} |
669
|
|
|
|
|
|
|
} |
670
|
|
|
|
|
|
|
) |
671
|
|
|
|
|
|
|
&& ( |
672
|
16
|
50
|
66
|
|
|
29
|
do { local $_ = $args->{"lvalue"}; /\%/ } |
|
9
|
|
66
|
|
|
18
|
|
|
9
|
|
|
|
|
71
|
|
673
|
|
|
|
|
|
|
) |
674
|
|
|
|
|
|
|
) |
675
|
|
|
|
|
|
|
); |
676
|
|
|
|
|
|
|
} |
677
|
|
|
|
|
|
|
or do { |
678
|
|
|
|
|
|
|
|
679
|
|
|
|
|
|
|
package Mite::Shim; |
680
|
|
|
|
|
|
|
( defined( $args->{"lvalue"} ) |
681
|
|
|
|
|
|
|
and !ref( $args->{"lvalue"} ) |
682
|
16
|
100
|
66
|
|
|
198
|
and $args->{"lvalue"} =~ m{\A(?:1)\z} ); |
683
|
|
|
|
|
|
|
} |
684
|
|
|
|
|
|
|
or |
685
|
16
|
100
|
66
|
|
|
32
|
do { package Mite::Shim; !defined( $args->{"lvalue"} ) } |
|
7
|
|
|
|
|
35
|
|
686
|
|
|
|
|
|
|
); |
687
|
|
|
|
|
|
|
} |
688
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
689
|
|
|
|
|
|
|
"lvalue", "MethodNameTemplate|One|Undef"; |
690
|
16
|
|
|
|
|
56
|
$self->{"lvalue"} = $args->{"lvalue"}; |
691
|
|
|
|
|
|
|
} |
692
|
|
|
|
|
|
|
|
693
|
|
|
|
|
|
|
# Attribute local_writer (type: MethodNameTemplate|One|Undef) |
694
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
695
|
173
|
100
|
|
|
|
628
|
if ( exists $args->{"local_writer"} ) { |
696
|
8
|
50
|
|
|
|
14
|
do { |
697
|
|
|
|
|
|
|
|
698
|
|
|
|
|
|
|
package Mite::Shim; |
699
|
|
|
|
|
|
|
( |
700
|
|
|
|
|
|
|
do { |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
package Mite::Shim; |
703
|
|
|
|
|
|
|
( |
704
|
|
|
|
|
|
|
( |
705
|
|
|
|
|
|
|
( |
706
|
|
|
|
|
|
|
do { |
707
|
|
|
|
|
|
|
|
708
|
|
|
|
|
|
|
package Mite::Shim; |
709
|
|
|
|
|
|
|
defined( $args->{"local_writer"} ) |
710
|
8
|
100
|
|
|
|
70
|
and do { |
711
|
|
|
|
|
|
|
ref( \$args->{"local_writer"} ) eq |
712
|
|
|
|
|
|
|
'SCALAR' |
713
|
|
|
|
|
|
|
or ref( |
714
|
|
|
|
|
|
|
\( |
715
|
|
|
|
|
|
|
my $val = |
716
|
2
|
50
|
|
|
|
13
|
$args->{"local_writer"} |
717
|
|
|
|
|
|
|
) |
718
|
|
|
|
|
|
|
) eq 'SCALAR'; |
719
|
|
|
|
|
|
|
} |
720
|
|
|
|
|
|
|
} |
721
|
|
|
|
|
|
|
) |
722
|
|
|
|
|
|
|
&& ( |
723
|
|
|
|
|
|
|
do { |
724
|
2
|
|
|
|
|
4
|
local $_ = $args->{"local_writer"}; |
725
|
2
|
|
|
|
|
23
|
/\A[^\W0-9]\w*\z/; |
726
|
|
|
|
|
|
|
} |
727
|
|
|
|
|
|
|
) |
728
|
|
|
|
|
|
|
) |
729
|
|
|
|
|
|
|
or ( |
730
|
|
|
|
|
|
|
( |
731
|
|
|
|
|
|
|
do { |
732
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
package Mite::Shim; |
734
|
|
|
|
|
|
|
defined( $args->{"local_writer"} ) |
735
|
7
|
100
|
|
|
|
88
|
and do { |
736
|
|
|
|
|
|
|
ref( \$args->{"local_writer"} ) eq |
737
|
|
|
|
|
|
|
'SCALAR' |
738
|
|
|
|
|
|
|
or ref( |
739
|
|
|
|
|
|
|
\( |
740
|
|
|
|
|
|
|
my $val = |
741
|
1
|
50
|
|
|
|
13
|
$args->{"local_writer"} |
742
|
|
|
|
|
|
|
) |
743
|
|
|
|
|
|
|
) eq 'SCALAR'; |
744
|
|
|
|
|
|
|
} |
745
|
|
|
|
|
|
|
} |
746
|
|
|
|
|
|
|
) |
747
|
|
|
|
|
|
|
&& ( |
748
|
8
|
100
|
66
|
|
|
15
|
do { |
|
|
|
100
|
|
|
|
|
749
|
1
|
|
|
|
|
3
|
local $_ = $args->{"local_writer"}; |
750
|
1
|
|
|
|
|
7
|
/\%/; |
751
|
|
|
|
|
|
|
} |
752
|
|
|
|
|
|
|
) |
753
|
|
|
|
|
|
|
) |
754
|
|
|
|
|
|
|
); |
755
|
|
|
|
|
|
|
} |
756
|
|
|
|
|
|
|
or do { |
757
|
|
|
|
|
|
|
|
758
|
|
|
|
|
|
|
package Mite::Shim; |
759
|
|
|
|
|
|
|
( defined( $args->{"local_writer"} ) |
760
|
|
|
|
|
|
|
and !ref( $args->{"local_writer"} ) |
761
|
7
|
100
|
66
|
|
|
68
|
and $args->{"local_writer"} =~ m{\A(?:1)\z} ); |
762
|
|
|
|
|
|
|
} |
763
|
8
|
100
|
100
|
|
|
18
|
or do { |
764
|
|
|
|
|
|
|
|
765
|
|
|
|
|
|
|
package Mite::Shim; |
766
|
6
|
|
|
|
|
37
|
!defined( $args->{"local_writer"} ); |
767
|
|
|
|
|
|
|
} |
768
|
|
|
|
|
|
|
); |
769
|
|
|
|
|
|
|
} |
770
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
771
|
|
|
|
|
|
|
"local_writer", "MethodNameTemplate|One|Undef"; |
772
|
8
|
|
|
|
|
23
|
$self->{"local_writer"} = $args->{"local_writer"}; |
773
|
|
|
|
|
|
|
} |
774
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
# Attribute isa (type: Str|Ref) |
776
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 77 |
777
|
173
|
100
|
|
|
|
598
|
if ( exists $args->{"isa"} ) { |
778
|
19
|
50
|
|
|
|
50
|
do { |
779
|
|
|
|
|
|
|
|
780
|
|
|
|
|
|
|
package Mite::Shim; |
781
|
|
|
|
|
|
|
( |
782
|
|
|
|
|
|
|
do { |
783
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
package Mite::Shim; |
785
|
19
|
50
|
|
|
|
204
|
defined( $args->{"isa"} ) and do { |
786
|
|
|
|
|
|
|
ref( \$args->{"isa"} ) eq 'SCALAR' |
787
|
19
|
100
|
|
|
|
344
|
or ref( \( my $val = $args->{"isa"} ) ) eq |
788
|
|
|
|
|
|
|
'SCALAR'; |
789
|
|
|
|
|
|
|
} |
790
|
|
|
|
|
|
|
} |
791
|
19
|
100
|
|
|
|
41
|
or do { package Mite::Shim; !!ref( $args->{"isa"} ) } |
|
2
|
|
|
|
|
20
|
|
792
|
|
|
|
|
|
|
); |
793
|
|
|
|
|
|
|
} |
794
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
795
|
|
|
|
|
|
|
"isa", "Str|Ref"; |
796
|
19
|
|
|
|
|
100
|
$self->{"isa"} = $args->{"isa"}; |
797
|
|
|
|
|
|
|
} |
798
|
|
|
|
|
|
|
|
799
|
|
|
|
|
|
|
# Attribute does (type: Str|Ref) |
800
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 82 |
801
|
173
|
50
|
|
|
|
588
|
if ( exists $args->{"does"} ) { |
802
|
0
|
0
|
|
|
|
0
|
do { |
803
|
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
package Mite::Shim; |
805
|
|
|
|
|
|
|
( |
806
|
|
|
|
|
|
|
do { |
807
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
package Mite::Shim; |
809
|
0
|
0
|
|
|
|
0
|
defined( $args->{"does"} ) and do { |
810
|
|
|
|
|
|
|
ref( \$args->{"does"} ) eq 'SCALAR' |
811
|
0
|
0
|
|
|
|
0
|
or ref( \( my $val = $args->{"does"} ) ) eq |
812
|
|
|
|
|
|
|
'SCALAR'; |
813
|
|
|
|
|
|
|
} |
814
|
|
|
|
|
|
|
} |
815
|
0
|
0
|
|
|
|
0
|
or do { package Mite::Shim; !!ref( $args->{"does"} ) } |
|
0
|
|
|
|
|
0
|
|
816
|
|
|
|
|
|
|
); |
817
|
|
|
|
|
|
|
} |
818
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
819
|
|
|
|
|
|
|
"does", "Str|Ref"; |
820
|
0
|
|
|
|
|
0
|
$self->{"does"} = $args->{"does"}; |
821
|
|
|
|
|
|
|
} |
822
|
|
|
|
|
|
|
|
823
|
|
|
|
|
|
|
# Attribute enum (type: ArrayRef[NonEmptyStr]) |
824
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 87 |
825
|
173
|
100
|
|
|
|
661
|
if ( exists $args->{"enum"} ) { |
826
|
|
|
|
|
|
|
( |
827
|
2
|
|
|
|
|
15
|
do { package Mite::Shim; ref( $args->{"enum"} ) eq 'ARRAY' } |
828
|
2
|
50
|
33
|
|
|
6
|
and do { |
829
|
2
|
|
|
|
|
4
|
my $ok = 1; |
830
|
2
|
|
|
|
|
4
|
for my $i ( @{ $args->{"enum"} } ) { |
|
2
|
|
|
|
|
8
|
|
831
|
|
|
|
|
|
|
( $ok = 0, last ) |
832
|
|
|
|
|
|
|
unless ( |
833
|
|
|
|
|
|
|
( |
834
|
6
|
50
|
33
|
|
|
12
|
do { |
835
|
|
|
|
|
|
|
|
836
|
|
|
|
|
|
|
package Mite::Shim; |
837
|
6
|
50
|
|
|
|
17
|
defined($i) and do { |
838
|
6
|
50
|
|
|
|
55
|
ref( \$i ) eq 'SCALAR' |
839
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
840
|
|
|
|
|
|
|
'SCALAR'; |
841
|
|
|
|
|
|
|
} |
842
|
|
|
|
|
|
|
} |
843
|
|
|
|
|
|
|
) |
844
|
|
|
|
|
|
|
&& ( length($i) > 0 ) |
845
|
|
|
|
|
|
|
); |
846
|
|
|
|
|
|
|
}; |
847
|
2
|
|
|
|
|
16
|
$ok; |
848
|
|
|
|
|
|
|
} |
849
|
|
|
|
|
|
|
) |
850
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
851
|
|
|
|
|
|
|
"enum", "ArrayRef[NonEmptyStr]"; |
852
|
2
|
|
|
|
|
16
|
$self->{"enum"} = $args->{"enum"}; |
853
|
|
|
|
|
|
|
} |
854
|
|
|
|
|
|
|
|
855
|
|
|
|
|
|
|
# Attribute type (type: Object|Undef) |
856
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 92 |
857
|
173
|
50
|
|
|
|
588
|
if ( exists $args->{"type"} ) { |
858
|
0
|
0
|
|
|
|
0
|
do { |
859
|
|
|
|
|
|
|
|
860
|
|
|
|
|
|
|
package Mite::Shim; |
861
|
|
|
|
|
|
|
( |
862
|
|
|
|
|
|
|
( |
863
|
|
|
|
|
|
|
do { |
864
|
|
|
|
|
|
|
|
865
|
|
|
|
|
|
|
package Mite::Shim; |
866
|
79
|
|
|
79
|
|
820
|
use Scalar::Util (); |
|
79
|
|
|
|
|
230
|
|
|
79
|
|
|
|
|
373884
|
|
867
|
0
|
|
|
|
|
0
|
Scalar::Util::blessed( $args->{"type"} ); |
868
|
|
|
|
|
|
|
} |
869
|
0
|
0
|
|
|
|
0
|
) or do { package Mite::Shim; !defined( $args->{"type"} ) } |
|
0
|
|
|
|
|
0
|
|
870
|
|
|
|
|
|
|
); |
871
|
|
|
|
|
|
|
} |
872
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
873
|
|
|
|
|
|
|
"type", "Object|Undef"; |
874
|
0
|
|
|
|
|
0
|
$self->{"type"} = $args->{"type"}; |
875
|
|
|
|
|
|
|
} |
876
|
|
|
|
|
|
|
|
877
|
|
|
|
|
|
|
# Attribute coerce (type: Bool) |
878
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 97 |
879
|
173
|
|
|
|
|
333
|
do { |
880
|
173
|
100
|
|
|
|
775
|
my $value = exists( $args->{"coerce"} ) ? $args->{"coerce"} : false; |
881
|
|
|
|
|
|
|
( |
882
|
173
|
50
|
66
|
|
|
1779
|
!ref $value |
|
|
|
66
|
|
|
|
|
883
|
|
|
|
|
|
|
and (!defined $value |
884
|
|
|
|
|
|
|
or $value eq q() |
885
|
|
|
|
|
|
|
or $value eq '0' |
886
|
|
|
|
|
|
|
or $value eq '1' ) |
887
|
|
|
|
|
|
|
) |
888
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
889
|
|
|
|
|
|
|
"coerce", "Bool"; |
890
|
173
|
|
|
|
|
756
|
$self->{"coerce"} = $value; |
891
|
|
|
|
|
|
|
}; |
892
|
|
|
|
|
|
|
|
893
|
|
|
|
|
|
|
# Attribute locked (type: Bool) |
894
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 102 |
895
|
173
|
|
|
|
|
426
|
do { |
896
|
173
|
100
|
|
|
|
678
|
my $value = exists( $args->{"locked"} ) ? $args->{"locked"} : false; |
897
|
|
|
|
|
|
|
( |
898
|
173
|
50
|
66
|
|
|
1781
|
!ref $value |
|
|
|
66
|
|
|
|
|
899
|
|
|
|
|
|
|
and (!defined $value |
900
|
|
|
|
|
|
|
or $value eq q() |
901
|
|
|
|
|
|
|
or $value eq '0' |
902
|
|
|
|
|
|
|
or $value eq '1' ) |
903
|
|
|
|
|
|
|
) |
904
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
905
|
|
|
|
|
|
|
"locked", "Bool"; |
906
|
173
|
|
|
|
|
792
|
$self->{"locked"} = $value; |
907
|
|
|
|
|
|
|
}; |
908
|
|
|
|
|
|
|
|
909
|
|
|
|
|
|
|
# Attribute default (type: Undef|Str|CodeRef|ScalarRef|Dict[]|Tuple[]) |
910
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 107 |
911
|
173
|
100
|
|
|
|
762
|
if ( exists $args->{"default"} ) { |
912
|
95
|
50
|
|
|
|
182
|
do { |
913
|
|
|
|
|
|
|
|
914
|
|
|
|
|
|
|
package Mite::Shim; |
915
|
|
|
|
|
|
|
( |
916
|
95
|
|
|
|
|
576
|
do { package Mite::Shim; !defined( $args->{"default"} ) } |
917
|
|
|
|
|
|
|
or do { |
918
|
|
|
|
|
|
|
|
919
|
|
|
|
|
|
|
package Mite::Shim; |
920
|
90
|
50
|
|
|
|
537
|
defined( $args->{"default"} ) and do { |
921
|
|
|
|
|
|
|
ref( \$args->{"default"} ) eq 'SCALAR' |
922
|
90
|
100
|
|
|
|
1003
|
or ref( \( my $val = $args->{"default"} ) ) eq |
923
|
|
|
|
|
|
|
'SCALAR'; |
924
|
|
|
|
|
|
|
} |
925
|
|
|
|
|
|
|
} |
926
|
|
|
|
|
|
|
or do { |
927
|
|
|
|
|
|
|
|
928
|
|
|
|
|
|
|
package Mite::Shim; |
929
|
34
|
|
|
|
|
327
|
ref( $args->{"default"} ) eq 'CODE'; |
930
|
|
|
|
|
|
|
} |
931
|
|
|
|
|
|
|
or do { |
932
|
|
|
|
|
|
|
|
933
|
|
|
|
|
|
|
package Mite::Shim; |
934
|
|
|
|
|
|
|
ref( $args->{"default"} ) eq 'SCALAR' |
935
|
5
|
100
|
|
|
|
62
|
or ref( $args->{"default"} ) eq 'REF'; |
936
|
|
|
|
|
|
|
} |
937
|
|
|
|
|
|
|
or do { |
938
|
|
|
|
|
|
|
|
939
|
|
|
|
|
|
|
package Mite::Shim; |
940
|
|
|
|
|
|
|
do { |
941
|
|
|
|
|
|
|
|
942
|
|
|
|
|
|
|
package Mite::Shim; |
943
|
4
|
|
|
|
|
37
|
ref( $args->{"default"} ) eq 'HASH'; |
944
|
|
|
|
|
|
|
} |
945
|
|
|
|
|
|
|
and |
946
|
4
|
100
|
|
|
|
7
|
not( grep !/\A(?:)\z/, keys %{ $args->{"default"} } ); |
|
1
|
|
|
|
|
10
|
|
947
|
|
|
|
|
|
|
} |
948
|
95
|
100
|
100
|
|
|
185
|
or do { |
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
949
|
|
|
|
|
|
|
|
950
|
|
|
|
|
|
|
package Mite::Shim; |
951
|
|
|
|
|
|
|
do { |
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
package Mite::Shim; |
954
|
3
|
|
|
|
|
28
|
ref( $args->{"default"} ) eq 'ARRAY'; |
955
|
|
|
|
|
|
|
} |
956
|
3
|
50
|
|
|
|
8
|
and @{ $args->{"default"} } == 0; |
|
3
|
|
|
|
|
22
|
|
957
|
|
|
|
|
|
|
} |
958
|
|
|
|
|
|
|
); |
959
|
|
|
|
|
|
|
} |
960
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
961
|
|
|
|
|
|
|
"default", "Undef|Str|CodeRef|ScalarRef|Dict[]|Tuple[]"; |
962
|
95
|
|
|
|
|
271
|
$self->{"default"} = $args->{"default"}; |
963
|
|
|
|
|
|
|
} |
964
|
|
|
|
|
|
|
|
965
|
|
|
|
|
|
|
# Attribute default_is_trusted (type: Bool) |
966
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 113 |
967
|
173
|
|
|
|
|
350
|
do { |
968
|
|
|
|
|
|
|
my $value = exists( $args->{"default_is_trusted"} ) |
969
|
173
|
100
|
|
|
|
646
|
? do { |
970
|
11
|
|
|
|
|
31
|
my $coerced_value = do { |
971
|
11
|
|
|
|
|
77
|
my $to_coerce = $args->{"default_is_trusted"}; |
972
|
|
|
|
|
|
|
( |
973
|
|
|
|
|
|
|
( |
974
|
|
|
|
|
|
|
!ref $to_coerce |
975
|
|
|
|
|
|
|
and (!defined $to_coerce |
976
|
|
|
|
|
|
|
or $to_coerce eq q() |
977
|
|
|
|
|
|
|
or $to_coerce eq '0' |
978
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
979
|
|
|
|
|
|
|
) |
980
|
|
|
|
|
|
|
) ? $to_coerce |
981
|
|
|
|
|
|
|
: ( ( !!1 ) ) |
982
|
11
|
50
|
33
|
|
|
270
|
? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
983
|
|
|
|
|
|
|
: $to_coerce; |
984
|
|
|
|
|
|
|
}; |
985
|
|
|
|
|
|
|
( |
986
|
|
|
|
|
|
|
( |
987
|
11
|
50
|
33
|
|
|
184
|
!ref $coerced_value |
988
|
|
|
|
|
|
|
and (!defined $coerced_value |
989
|
|
|
|
|
|
|
or $coerced_value eq q() |
990
|
|
|
|
|
|
|
or $coerced_value eq '0' |
991
|
|
|
|
|
|
|
or $coerced_value eq '1' ) |
992
|
|
|
|
|
|
|
) |
993
|
|
|
|
|
|
|
) |
994
|
|
|
|
|
|
|
? $coerced_value |
995
|
|
|
|
|
|
|
: croak( "Type check failed in constructor: %s should be %s", |
996
|
|
|
|
|
|
|
"default_is_trusted", "Bool" ); |
997
|
|
|
|
|
|
|
} |
998
|
|
|
|
|
|
|
: false; |
999
|
173
|
|
|
|
|
585
|
$self->{"default_is_trusted"} = $value; |
1000
|
|
|
|
|
|
|
}; |
1001
|
|
|
|
|
|
|
|
1002
|
|
|
|
|
|
|
# Attribute default_does_trigger (type: Bool) |
1003
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 113 |
1004
|
173
|
|
|
|
|
385
|
do { |
1005
|
|
|
|
|
|
|
my $value = exists( $args->{"default_does_trigger"} ) |
1006
|
173
|
100
|
|
|
|
662
|
? do { |
1007
|
9
|
|
|
|
|
36
|
my $coerced_value = do { |
1008
|
9
|
|
|
|
|
36
|
my $to_coerce = $args->{"default_does_trigger"}; |
1009
|
|
|
|
|
|
|
( |
1010
|
|
|
|
|
|
|
( |
1011
|
|
|
|
|
|
|
!ref $to_coerce |
1012
|
|
|
|
|
|
|
and (!defined $to_coerce |
1013
|
|
|
|
|
|
|
or $to_coerce eq q() |
1014
|
|
|
|
|
|
|
or $to_coerce eq '0' |
1015
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
1016
|
|
|
|
|
|
|
) |
1017
|
|
|
|
|
|
|
) ? $to_coerce |
1018
|
|
|
|
|
|
|
: ( ( !!1 ) ) |
1019
|
9
|
50
|
33
|
|
|
132
|
? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1020
|
|
|
|
|
|
|
: $to_coerce; |
1021
|
|
|
|
|
|
|
}; |
1022
|
|
|
|
|
|
|
( |
1023
|
|
|
|
|
|
|
( |
1024
|
9
|
50
|
33
|
|
|
129
|
!ref $coerced_value |
1025
|
|
|
|
|
|
|
and (!defined $coerced_value |
1026
|
|
|
|
|
|
|
or $coerced_value eq q() |
1027
|
|
|
|
|
|
|
or $coerced_value eq '0' |
1028
|
|
|
|
|
|
|
or $coerced_value eq '1' ) |
1029
|
|
|
|
|
|
|
) |
1030
|
|
|
|
|
|
|
) |
1031
|
|
|
|
|
|
|
? $coerced_value |
1032
|
|
|
|
|
|
|
: croak( "Type check failed in constructor: %s should be %s", |
1033
|
|
|
|
|
|
|
"default_does_trigger", "Bool" ); |
1034
|
|
|
|
|
|
|
} |
1035
|
|
|
|
|
|
|
: false; |
1036
|
173
|
|
|
|
|
480
|
$self->{"default_does_trigger"} = $value; |
1037
|
|
|
|
|
|
|
}; |
1038
|
|
|
|
|
|
|
|
1039
|
|
|
|
|
|
|
# Attribute skip_argc_check (type: Bool) |
1040
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 113 |
1041
|
173
|
|
|
|
|
308
|
do { |
1042
|
|
|
|
|
|
|
my $value = exists( $args->{"skip_argc_check"} ) |
1043
|
173
|
100
|
|
|
|
675
|
? do { |
1044
|
7
|
|
|
|
|
22
|
my $coerced_value = do { |
1045
|
7
|
|
|
|
|
19
|
my $to_coerce = $args->{"skip_argc_check"}; |
1046
|
|
|
|
|
|
|
( |
1047
|
|
|
|
|
|
|
( |
1048
|
|
|
|
|
|
|
!ref $to_coerce |
1049
|
|
|
|
|
|
|
and (!defined $to_coerce |
1050
|
|
|
|
|
|
|
or $to_coerce eq q() |
1051
|
|
|
|
|
|
|
or $to_coerce eq '0' |
1052
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
1053
|
|
|
|
|
|
|
) |
1054
|
|
|
|
|
|
|
) ? $to_coerce |
1055
|
|
|
|
|
|
|
: ( ( !!1 ) ) |
1056
|
7
|
50
|
33
|
|
|
176
|
? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1057
|
|
|
|
|
|
|
: $to_coerce; |
1058
|
|
|
|
|
|
|
}; |
1059
|
|
|
|
|
|
|
( |
1060
|
|
|
|
|
|
|
( |
1061
|
7
|
50
|
33
|
|
|
70
|
!ref $coerced_value |
1062
|
|
|
|
|
|
|
and (!defined $coerced_value |
1063
|
|
|
|
|
|
|
or $coerced_value eq q() |
1064
|
|
|
|
|
|
|
or $coerced_value eq '0' |
1065
|
|
|
|
|
|
|
or $coerced_value eq '1' ) |
1066
|
|
|
|
|
|
|
) |
1067
|
|
|
|
|
|
|
) |
1068
|
|
|
|
|
|
|
? $coerced_value |
1069
|
|
|
|
|
|
|
: croak( "Type check failed in constructor: %s should be %s", |
1070
|
|
|
|
|
|
|
"skip_argc_check", "Bool" ); |
1071
|
|
|
|
|
|
|
} |
1072
|
|
|
|
|
|
|
: false; |
1073
|
173
|
|
|
|
|
522
|
$self->{"skip_argc_check"} = $value; |
1074
|
|
|
|
|
|
|
}; |
1075
|
|
|
|
|
|
|
|
1076
|
|
|
|
|
|
|
# Attribute lazy (type: Bool) |
1077
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 120 |
1078
|
173
|
|
|
|
|
332
|
do { |
1079
|
173
|
100
|
|
|
|
674
|
my $value = exists( $args->{"lazy"} ) ? $args->{"lazy"} : false; |
1080
|
|
|
|
|
|
|
( |
1081
|
173
|
50
|
66
|
|
|
1919
|
!ref $value |
|
|
|
66
|
|
|
|
|
1082
|
|
|
|
|
|
|
and (!defined $value |
1083
|
|
|
|
|
|
|
or $value eq q() |
1084
|
|
|
|
|
|
|
or $value eq '0' |
1085
|
|
|
|
|
|
|
or $value eq '1' ) |
1086
|
|
|
|
|
|
|
) |
1087
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
1088
|
|
|
|
|
|
|
"lazy", "Bool"; |
1089
|
173
|
|
|
|
|
567
|
$self->{"lazy"} = $value; |
1090
|
|
|
|
|
|
|
}; |
1091
|
|
|
|
|
|
|
|
1092
|
|
|
|
|
|
|
# Attribute coderef_default_variable (type: NonEmptyStr) |
1093
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 132 |
1094
|
173
|
50
|
|
|
|
716
|
if ( exists $args->{"coderef_default_variable"} ) { |
1095
|
|
|
|
|
|
|
( |
1096
|
|
|
|
|
|
|
( |
1097
|
|
|
|
|
|
|
do { |
1098
|
|
|
|
|
|
|
|
1099
|
|
|
|
|
|
|
package Mite::Shim; |
1100
|
0
|
0
|
|
|
|
0
|
defined( $args->{"coderef_default_variable"} ) and do { |
1101
|
|
|
|
|
|
|
ref( \$args->{"coderef_default_variable"} ) eq |
1102
|
|
|
|
|
|
|
'SCALAR' |
1103
|
|
|
|
|
|
|
or ref( |
1104
|
|
|
|
|
|
|
\( |
1105
|
|
|
|
|
|
|
my $val = |
1106
|
0
|
0
|
|
|
|
0
|
$args->{"coderef_default_variable"} |
1107
|
|
|
|
|
|
|
) |
1108
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1109
|
|
|
|
|
|
|
} |
1110
|
|
|
|
|
|
|
} |
1111
|
|
|
|
|
|
|
) |
1112
|
0
|
0
|
0
|
|
|
0
|
&& do { |
1113
|
|
|
|
|
|
|
|
1114
|
|
|
|
|
|
|
package Mite::Shim; |
1115
|
0
|
|
|
|
|
0
|
length( $args->{"coderef_default_variable"} ) > 0; |
1116
|
|
|
|
|
|
|
} |
1117
|
|
|
|
|
|
|
) |
1118
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
1119
|
|
|
|
|
|
|
"coderef_default_variable", "NonEmptyStr"; |
1120
|
|
|
|
|
|
|
$self->{"coderef_default_variable"} = |
1121
|
0
|
|
|
|
|
0
|
$args->{"coderef_default_variable"}; |
1122
|
|
|
|
|
|
|
} |
1123
|
|
|
|
|
|
|
|
1124
|
|
|
|
|
|
|
# Attribute trigger (type: MethodNameTemplate|One|CodeRef) |
1125
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 134 |
1126
|
173
|
100
|
|
|
|
671
|
if ( exists $args->{"trigger"} ) { |
1127
|
7
|
50
|
|
|
|
18
|
do { |
1128
|
|
|
|
|
|
|
|
1129
|
|
|
|
|
|
|
package Mite::Shim; |
1130
|
|
|
|
|
|
|
( |
1131
|
|
|
|
|
|
|
do { |
1132
|
|
|
|
|
|
|
|
1133
|
|
|
|
|
|
|
package Mite::Shim; |
1134
|
|
|
|
|
|
|
( |
1135
|
|
|
|
|
|
|
( |
1136
|
|
|
|
|
|
|
( |
1137
|
|
|
|
|
|
|
do { |
1138
|
|
|
|
|
|
|
|
1139
|
|
|
|
|
|
|
package Mite::Shim; |
1140
|
7
|
50
|
|
|
|
37
|
defined( $args->{"trigger"} ) and do { |
1141
|
|
|
|
|
|
|
ref( \$args->{"trigger"} ) eq |
1142
|
|
|
|
|
|
|
'SCALAR' |
1143
|
|
|
|
|
|
|
or ref( |
1144
|
|
|
|
|
|
|
\( |
1145
|
7
|
50
|
|
|
|
82
|
my $val = $args->{"trigger"} |
1146
|
|
|
|
|
|
|
) |
1147
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1148
|
|
|
|
|
|
|
} |
1149
|
|
|
|
|
|
|
} |
1150
|
|
|
|
|
|
|
) |
1151
|
|
|
|
|
|
|
&& ( |
1152
|
|
|
|
|
|
|
do { |
1153
|
7
|
|
|
|
|
25
|
local $_ = $args->{"trigger"}; |
1154
|
7
|
|
|
|
|
59
|
/\A[^\W0-9]\w*\z/; |
1155
|
|
|
|
|
|
|
} |
1156
|
|
|
|
|
|
|
) |
1157
|
|
|
|
|
|
|
) |
1158
|
|
|
|
|
|
|
or ( |
1159
|
|
|
|
|
|
|
( |
1160
|
|
|
|
|
|
|
do { |
1161
|
|
|
|
|
|
|
|
1162
|
|
|
|
|
|
|
package Mite::Shim; |
1163
|
7
|
50
|
|
|
|
45
|
defined( $args->{"trigger"} ) and do { |
1164
|
|
|
|
|
|
|
ref( \$args->{"trigger"} ) eq |
1165
|
|
|
|
|
|
|
'SCALAR' |
1166
|
|
|
|
|
|
|
or ref( |
1167
|
|
|
|
|
|
|
\( |
1168
|
7
|
50
|
|
|
|
50
|
my $val = $args->{"trigger"} |
1169
|
|
|
|
|
|
|
) |
1170
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1171
|
|
|
|
|
|
|
} |
1172
|
|
|
|
|
|
|
} |
1173
|
|
|
|
|
|
|
) |
1174
|
|
|
|
|
|
|
&& ( |
1175
|
7
|
50
|
33
|
|
|
15
|
do { local $_ = $args->{"trigger"}; /\%/ } |
|
7
|
|
33
|
|
|
21
|
|
|
7
|
|
|
|
|
68
|
|
1176
|
|
|
|
|
|
|
) |
1177
|
|
|
|
|
|
|
) |
1178
|
|
|
|
|
|
|
); |
1179
|
|
|
|
|
|
|
} |
1180
|
|
|
|
|
|
|
or do { |
1181
|
|
|
|
|
|
|
|
1182
|
|
|
|
|
|
|
package Mite::Shim; |
1183
|
|
|
|
|
|
|
( defined( $args->{"trigger"} ) |
1184
|
|
|
|
|
|
|
and !ref( $args->{"trigger"} ) |
1185
|
7
|
50
|
33
|
|
|
148
|
and $args->{"trigger"} =~ m{\A(?:1)\z} ); |
1186
|
|
|
|
|
|
|
} |
1187
|
7
|
50
|
33
|
|
|
28
|
or do { |
1188
|
|
|
|
|
|
|
|
1189
|
|
|
|
|
|
|
package Mite::Shim; |
1190
|
0
|
|
|
|
|
0
|
ref( $args->{"trigger"} ) eq 'CODE'; |
1191
|
|
|
|
|
|
|
} |
1192
|
|
|
|
|
|
|
); |
1193
|
|
|
|
|
|
|
} |
1194
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
1195
|
|
|
|
|
|
|
"trigger", "MethodNameTemplate|One|CodeRef"; |
1196
|
7
|
|
|
|
|
25
|
$self->{"trigger"} = $args->{"trigger"}; |
1197
|
|
|
|
|
|
|
} |
1198
|
|
|
|
|
|
|
|
1199
|
|
|
|
|
|
|
# Attribute builder (type: MethodNameTemplate|One|CodeRef) |
1200
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 134 |
1201
|
173
|
100
|
|
|
|
590
|
if ( exists $args->{"builder"} ) { |
1202
|
8
|
50
|
|
|
|
33
|
do { |
1203
|
|
|
|
|
|
|
|
1204
|
|
|
|
|
|
|
package Mite::Shim; |
1205
|
|
|
|
|
|
|
( |
1206
|
|
|
|
|
|
|
do { |
1207
|
|
|
|
|
|
|
|
1208
|
|
|
|
|
|
|
package Mite::Shim; |
1209
|
|
|
|
|
|
|
( |
1210
|
|
|
|
|
|
|
( |
1211
|
|
|
|
|
|
|
( |
1212
|
|
|
|
|
|
|
do { |
1213
|
|
|
|
|
|
|
|
1214
|
|
|
|
|
|
|
package Mite::Shim; |
1215
|
8
|
50
|
|
|
|
115
|
defined( $args->{"builder"} ) and do { |
1216
|
|
|
|
|
|
|
ref( \$args->{"builder"} ) eq |
1217
|
|
|
|
|
|
|
'SCALAR' |
1218
|
|
|
|
|
|
|
or ref( |
1219
|
|
|
|
|
|
|
\( |
1220
|
8
|
100
|
|
|
|
189
|
my $val = $args->{"builder"} |
1221
|
|
|
|
|
|
|
) |
1222
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1223
|
|
|
|
|
|
|
} |
1224
|
|
|
|
|
|
|
} |
1225
|
|
|
|
|
|
|
) |
1226
|
|
|
|
|
|
|
&& ( |
1227
|
|
|
|
|
|
|
do { |
1228
|
1
|
|
|
|
|
3
|
local $_ = $args->{"builder"}; |
1229
|
1
|
|
|
|
|
7
|
/\A[^\W0-9]\w*\z/; |
1230
|
|
|
|
|
|
|
} |
1231
|
|
|
|
|
|
|
) |
1232
|
|
|
|
|
|
|
) |
1233
|
|
|
|
|
|
|
or ( |
1234
|
|
|
|
|
|
|
( |
1235
|
|
|
|
|
|
|
do { |
1236
|
|
|
|
|
|
|
|
1237
|
|
|
|
|
|
|
package Mite::Shim; |
1238
|
8
|
50
|
|
|
|
62
|
defined( $args->{"builder"} ) and do { |
1239
|
|
|
|
|
|
|
ref( \$args->{"builder"} ) eq |
1240
|
|
|
|
|
|
|
'SCALAR' |
1241
|
|
|
|
|
|
|
or ref( |
1242
|
|
|
|
|
|
|
\( |
1243
|
8
|
100
|
|
|
|
160
|
my $val = $args->{"builder"} |
1244
|
|
|
|
|
|
|
) |
1245
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1246
|
|
|
|
|
|
|
} |
1247
|
|
|
|
|
|
|
} |
1248
|
|
|
|
|
|
|
) |
1249
|
|
|
|
|
|
|
&& ( |
1250
|
8
|
50
|
66
|
|
|
23
|
do { local $_ = $args->{"builder"}; /\%/ } |
|
1
|
|
66
|
|
|
4
|
|
|
1
|
|
|
|
|
14
|
|
1251
|
|
|
|
|
|
|
) |
1252
|
|
|
|
|
|
|
) |
1253
|
|
|
|
|
|
|
); |
1254
|
|
|
|
|
|
|
} |
1255
|
|
|
|
|
|
|
or do { |
1256
|
|
|
|
|
|
|
|
1257
|
|
|
|
|
|
|
package Mite::Shim; |
1258
|
|
|
|
|
|
|
( defined( $args->{"builder"} ) |
1259
|
|
|
|
|
|
|
and !ref( $args->{"builder"} ) |
1260
|
8
|
100
|
66
|
|
|
128
|
and $args->{"builder"} =~ m{\A(?:1)\z} ); |
1261
|
|
|
|
|
|
|
} |
1262
|
8
|
100
|
66
|
|
|
25
|
or do { |
1263
|
|
|
|
|
|
|
|
1264
|
|
|
|
|
|
|
package Mite::Shim; |
1265
|
7
|
|
|
|
|
51
|
ref( $args->{"builder"} ) eq 'CODE'; |
1266
|
|
|
|
|
|
|
} |
1267
|
|
|
|
|
|
|
); |
1268
|
|
|
|
|
|
|
} |
1269
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
1270
|
|
|
|
|
|
|
"builder", "MethodNameTemplate|One|CodeRef"; |
1271
|
8
|
|
|
|
|
40
|
$self->{"builder"} = $args->{"builder"}; |
1272
|
|
|
|
|
|
|
} |
1273
|
|
|
|
|
|
|
|
1274
|
|
|
|
|
|
|
# Attribute clone (type: MethodNameTemplate|One|CodeRef|Undef) |
1275
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 139 |
1276
|
173
|
100
|
|
|
|
570
|
if ( exists $args->{"clone"} ) { |
1277
|
7
|
50
|
|
|
|
13
|
do { |
1278
|
|
|
|
|
|
|
|
1279
|
|
|
|
|
|
|
package Mite::Shim; |
1280
|
|
|
|
|
|
|
( |
1281
|
|
|
|
|
|
|
do { |
1282
|
|
|
|
|
|
|
|
1283
|
|
|
|
|
|
|
package Mite::Shim; |
1284
|
|
|
|
|
|
|
( |
1285
|
|
|
|
|
|
|
( |
1286
|
|
|
|
|
|
|
( |
1287
|
|
|
|
|
|
|
do { |
1288
|
|
|
|
|
|
|
|
1289
|
|
|
|
|
|
|
package Mite::Shim; |
1290
|
7
|
50
|
|
|
|
26
|
defined( $args->{"clone"} ) and do { |
1291
|
|
|
|
|
|
|
ref( \$args->{"clone"} ) eq 'SCALAR' |
1292
|
|
|
|
|
|
|
or ref( |
1293
|
7
|
100
|
|
|
|
51
|
\( my $val = $args->{"clone"} ) |
1294
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1295
|
|
|
|
|
|
|
} |
1296
|
|
|
|
|
|
|
} |
1297
|
|
|
|
|
|
|
) |
1298
|
|
|
|
|
|
|
&& ( |
1299
|
|
|
|
|
|
|
do { |
1300
|
6
|
|
|
|
|
15
|
local $_ = $args->{"clone"}; |
1301
|
6
|
|
|
|
|
53
|
/\A[^\W0-9]\w*\z/; |
1302
|
|
|
|
|
|
|
} |
1303
|
|
|
|
|
|
|
) |
1304
|
|
|
|
|
|
|
) |
1305
|
|
|
|
|
|
|
or ( |
1306
|
|
|
|
|
|
|
( |
1307
|
|
|
|
|
|
|
do { |
1308
|
|
|
|
|
|
|
|
1309
|
|
|
|
|
|
|
package Mite::Shim; |
1310
|
7
|
50
|
|
|
|
35
|
defined( $args->{"clone"} ) and do { |
1311
|
|
|
|
|
|
|
ref( \$args->{"clone"} ) eq 'SCALAR' |
1312
|
|
|
|
|
|
|
or ref( |
1313
|
7
|
100
|
|
|
|
65
|
\( my $val = $args->{"clone"} ) |
1314
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1315
|
|
|
|
|
|
|
} |
1316
|
|
|
|
|
|
|
} |
1317
|
|
|
|
|
|
|
) |
1318
|
|
|
|
|
|
|
&& ( |
1319
|
7
|
50
|
100
|
|
|
19
|
do { local $_ = $args->{"clone"}; /\%/ } |
|
6
|
|
66
|
|
|
13
|
|
|
6
|
|
|
|
|
44
|
|
1320
|
|
|
|
|
|
|
) |
1321
|
|
|
|
|
|
|
) |
1322
|
|
|
|
|
|
|
); |
1323
|
|
|
|
|
|
|
} |
1324
|
|
|
|
|
|
|
or do { |
1325
|
|
|
|
|
|
|
|
1326
|
|
|
|
|
|
|
package Mite::Shim; |
1327
|
|
|
|
|
|
|
( defined( $args->{"clone"} ) |
1328
|
|
|
|
|
|
|
and !ref( $args->{"clone"} ) |
1329
|
6
|
100
|
66
|
|
|
69
|
and $args->{"clone"} =~ m{\A(?:1)\z} ); |
1330
|
|
|
|
|
|
|
} |
1331
|
|
|
|
|
|
|
or do { |
1332
|
|
|
|
|
|
|
|
1333
|
|
|
|
|
|
|
package Mite::Shim; |
1334
|
1
|
|
|
|
|
6
|
ref( $args->{"clone"} ) eq 'CODE'; |
1335
|
|
|
|
|
|
|
} |
1336
|
7
|
50
|
100
|
|
|
15
|
or do { package Mite::Shim; !defined( $args->{"clone"} ) } |
|
0
|
|
66
|
|
|
0
|
|
1337
|
|
|
|
|
|
|
); |
1338
|
|
|
|
|
|
|
} |
1339
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
1340
|
|
|
|
|
|
|
"clone", "MethodNameTemplate|One|CodeRef|Undef"; |
1341
|
7
|
|
|
|
|
28
|
$self->{"clone"} = $args->{"clone"}; |
1342
|
|
|
|
|
|
|
} |
1343
|
|
|
|
|
|
|
|
1344
|
|
|
|
|
|
|
# Attribute clone_on_read (type: Bool) |
1345
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 148 |
1346
|
173
|
100
|
|
|
|
618
|
if ( exists $args->{"clone_on_read"} ) { |
1347
|
4
|
|
|
|
|
6
|
do { |
1348
|
4
|
|
|
|
|
7
|
my $coerced_value = do { |
1349
|
4
|
|
|
|
|
7
|
my $to_coerce = $args->{"clone_on_read"}; |
1350
|
|
|
|
|
|
|
( |
1351
|
|
|
|
|
|
|
( |
1352
|
|
|
|
|
|
|
!ref $to_coerce |
1353
|
|
|
|
|
|
|
and (!defined $to_coerce |
1354
|
|
|
|
|
|
|
or $to_coerce eq q() |
1355
|
|
|
|
|
|
|
or $to_coerce eq '0' |
1356
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
1357
|
|
|
|
|
|
|
) |
1358
|
|
|
|
|
|
|
) ? $to_coerce |
1359
|
|
|
|
|
|
|
: ( ( !!1 ) ) |
1360
|
4
|
50
|
33
|
|
|
38
|
? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1361
|
|
|
|
|
|
|
: $to_coerce; |
1362
|
|
|
|
|
|
|
}; |
1363
|
|
|
|
|
|
|
( |
1364
|
4
|
50
|
66
|
|
|
34
|
!ref $coerced_value |
|
|
|
66
|
|
|
|
|
1365
|
|
|
|
|
|
|
and (!defined $coerced_value |
1366
|
|
|
|
|
|
|
or $coerced_value eq q() |
1367
|
|
|
|
|
|
|
or $coerced_value eq '0' |
1368
|
|
|
|
|
|
|
or $coerced_value eq '1' ) |
1369
|
|
|
|
|
|
|
) |
1370
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
1371
|
|
|
|
|
|
|
"clone_on_read", "Bool"; |
1372
|
4
|
|
|
|
|
8
|
$self->{"clone_on_read"} = $coerced_value; |
1373
|
|
|
|
|
|
|
}; |
1374
|
|
|
|
|
|
|
} |
1375
|
|
|
|
|
|
|
|
1376
|
|
|
|
|
|
|
# Attribute clone_on_write (type: Bool) |
1377
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 148 |
1378
|
173
|
100
|
|
|
|
647
|
if ( exists $args->{"clone_on_write"} ) { |
1379
|
4
|
|
|
|
|
8
|
do { |
1380
|
4
|
|
|
|
|
5
|
my $coerced_value = do { |
1381
|
4
|
|
|
|
|
9
|
my $to_coerce = $args->{"clone_on_write"}; |
1382
|
|
|
|
|
|
|
( |
1383
|
|
|
|
|
|
|
( |
1384
|
|
|
|
|
|
|
!ref $to_coerce |
1385
|
|
|
|
|
|
|
and (!defined $to_coerce |
1386
|
|
|
|
|
|
|
or $to_coerce eq q() |
1387
|
|
|
|
|
|
|
or $to_coerce eq '0' |
1388
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
1389
|
|
|
|
|
|
|
) |
1390
|
|
|
|
|
|
|
) ? $to_coerce |
1391
|
|
|
|
|
|
|
: ( ( !!1 ) ) |
1392
|
4
|
50
|
33
|
|
|
57
|
? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1393
|
|
|
|
|
|
|
: $to_coerce; |
1394
|
|
|
|
|
|
|
}; |
1395
|
|
|
|
|
|
|
( |
1396
|
4
|
50
|
66
|
|
|
34
|
!ref $coerced_value |
|
|
|
66
|
|
|
|
|
1397
|
|
|
|
|
|
|
and (!defined $coerced_value |
1398
|
|
|
|
|
|
|
or $coerced_value eq q() |
1399
|
|
|
|
|
|
|
or $coerced_value eq '0' |
1400
|
|
|
|
|
|
|
or $coerced_value eq '1' ) |
1401
|
|
|
|
|
|
|
) |
1402
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
1403
|
|
|
|
|
|
|
"clone_on_write", "Bool"; |
1404
|
4
|
|
|
|
|
31
|
$self->{"clone_on_write"} = $coerced_value; |
1405
|
|
|
|
|
|
|
}; |
1406
|
|
|
|
|
|
|
} |
1407
|
|
|
|
|
|
|
|
1408
|
|
|
|
|
|
|
# Attribute documentation |
1409
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 150 |
1410
|
173
|
100
|
|
|
|
627
|
if ( exists $args->{"documentation"} ) { |
1411
|
1
|
|
|
|
|
2
|
$self->{"documentation"} = $args->{"documentation"}; |
1412
|
|
|
|
|
|
|
} |
1413
|
|
|
|
|
|
|
|
1414
|
|
|
|
|
|
|
# Attribute handles (type: HandlesHash|Enum["1","2"]) |
1415
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 154 |
1416
|
173
|
100
|
|
|
|
606
|
if ( exists $args->{"handles"} ) { |
1417
|
9
|
|
|
|
|
30
|
do { |
1418
|
9
|
|
|
|
|
22
|
my $coerced_value = do { |
1419
|
9
|
|
|
|
|
26
|
my $to_coerce = $args->{"handles"}; |
1420
|
|
|
|
|
|
|
( |
1421
|
|
|
|
|
|
|
do { |
1422
|
|
|
|
|
|
|
|
1423
|
|
|
|
|
|
|
package Mite::Shim; |
1424
|
|
|
|
|
|
|
( |
1425
|
|
|
|
|
|
|
do { |
1426
|
|
|
|
|
|
|
|
1427
|
|
|
|
|
|
|
package Mite::Shim; |
1428
|
9
|
100
|
|
|
|
54
|
( ref($to_coerce) eq 'HASH' ) and do { |
1429
|
5
|
|
|
|
|
15
|
my $ok = 1; |
1430
|
5
|
|
|
|
|
15
|
for my $v ( values %{$to_coerce} ) { |
|
5
|
|
|
|
|
23
|
|
1431
|
10
|
50
|
|
|
|
18
|
( $ok = 0, last ) unless do { |
1432
|
|
|
|
|
|
|
|
1433
|
|
|
|
|
|
|
package Mite::Shim; |
1434
|
|
|
|
|
|
|
( |
1435
|
|
|
|
|
|
|
( |
1436
|
|
|
|
|
|
|
( |
1437
|
|
|
|
|
|
|
do { |
1438
|
|
|
|
|
|
|
|
1439
|
|
|
|
|
|
|
package Mite::Shim; |
1440
|
|
|
|
|
|
|
defined($v) |
1441
|
10
|
50
|
|
|
|
33
|
and do { |
1442
|
10
|
100
|
|
|
|
86
|
ref( \$v ) |
1443
|
|
|
|
|
|
|
eq |
1444
|
|
|
|
|
|
|
'SCALAR' |
1445
|
|
|
|
|
|
|
or ref( |
1446
|
|
|
|
|
|
|
\( |
1447
|
|
|
|
|
|
|
my $val |
1448
|
|
|
|
|
|
|
= $v |
1449
|
|
|
|
|
|
|
) |
1450
|
|
|
|
|
|
|
) eq |
1451
|
|
|
|
|
|
|
'SCALAR'; |
1452
|
|
|
|
|
|
|
} |
1453
|
|
|
|
|
|
|
} |
1454
|
|
|
|
|
|
|
) |
1455
|
|
|
|
|
|
|
&& ( |
1456
|
10
|
50
|
66
|
|
|
15
|
do { |
|
|
|
66
|
|
|
|
|
1457
|
8
|
|
|
|
|
27
|
local $_ = $v; |
1458
|
8
|
|
|
|
|
79
|
/\A[^\W0-9]\w*\z/; |
1459
|
|
|
|
|
|
|
} |
1460
|
|
|
|
|
|
|
) |
1461
|
|
|
|
|
|
|
) |
1462
|
|
|
|
|
|
|
or ( ref($v) eq 'ARRAY' ) |
1463
|
|
|
|
|
|
|
or ( ref($v) eq 'CODE' ) |
1464
|
|
|
|
|
|
|
); |
1465
|
|
|
|
|
|
|
} |
1466
|
|
|
|
|
|
|
}; |
1467
|
5
|
|
|
|
|
25
|
for my $k ( keys %{$to_coerce} ) { |
|
5
|
|
|
|
|
20
|
|
1468
|
10
|
50
|
|
|
|
25
|
( $ok = 0, last ) unless do { |
1469
|
|
|
|
|
|
|
|
1470
|
|
|
|
|
|
|
package Mite::Shim; |
1471
|
|
|
|
|
|
|
( |
1472
|
|
|
|
|
|
|
( |
1473
|
|
|
|
|
|
|
( |
1474
|
|
|
|
|
|
|
do { |
1475
|
|
|
|
|
|
|
|
1476
|
|
|
|
|
|
|
package Mite::Shim; |
1477
|
|
|
|
|
|
|
defined($k) |
1478
|
10
|
50
|
|
|
|
32
|
and do { |
1479
|
10
|
50
|
|
|
|
66
|
ref( \$k ) |
1480
|
|
|
|
|
|
|
eq |
1481
|
|
|
|
|
|
|
'SCALAR' |
1482
|
|
|
|
|
|
|
or ref( |
1483
|
|
|
|
|
|
|
\( |
1484
|
|
|
|
|
|
|
my $val |
1485
|
|
|
|
|
|
|
= $k |
1486
|
|
|
|
|
|
|
) |
1487
|
|
|
|
|
|
|
) eq |
1488
|
|
|
|
|
|
|
'SCALAR'; |
1489
|
|
|
|
|
|
|
} |
1490
|
|
|
|
|
|
|
} |
1491
|
|
|
|
|
|
|
) |
1492
|
|
|
|
|
|
|
&& ( |
1493
|
|
|
|
|
|
|
do { |
1494
|
10
|
|
|
|
|
19
|
local $_ = $k; |
1495
|
10
|
|
|
|
|
73
|
/\A[^\W0-9]\w*\z/; |
1496
|
|
|
|
|
|
|
} |
1497
|
|
|
|
|
|
|
) |
1498
|
|
|
|
|
|
|
) |
1499
|
|
|
|
|
|
|
or ( |
1500
|
|
|
|
|
|
|
( |
1501
|
|
|
|
|
|
|
do { |
1502
|
|
|
|
|
|
|
|
1503
|
|
|
|
|
|
|
package Mite::Shim; |
1504
|
|
|
|
|
|
|
defined($k) |
1505
|
4
|
50
|
|
|
|
13
|
and do { |
1506
|
4
|
50
|
|
|
|
44
|
ref( \$k ) |
1507
|
|
|
|
|
|
|
eq |
1508
|
|
|
|
|
|
|
'SCALAR' |
1509
|
|
|
|
|
|
|
or ref( |
1510
|
|
|
|
|
|
|
\( |
1511
|
|
|
|
|
|
|
my $val |
1512
|
|
|
|
|
|
|
= $k |
1513
|
|
|
|
|
|
|
) |
1514
|
|
|
|
|
|
|
) eq |
1515
|
|
|
|
|
|
|
'SCALAR'; |
1516
|
|
|
|
|
|
|
} |
1517
|
|
|
|
|
|
|
} |
1518
|
|
|
|
|
|
|
) |
1519
|
|
|
|
|
|
|
&& ( |
1520
|
10
|
100
|
33
|
|
|
24
|
do { |
|
|
|
66
|
|
|
|
|
1521
|
4
|
|
|
|
|
10
|
local $_ = $k; |
1522
|
4
|
|
|
|
|
22
|
/\%/; |
1523
|
|
|
|
|
|
|
} |
1524
|
|
|
|
|
|
|
) |
1525
|
|
|
|
|
|
|
) |
1526
|
|
|
|
|
|
|
); |
1527
|
|
|
|
|
|
|
} |
1528
|
|
|
|
|
|
|
}; |
1529
|
5
|
|
|
|
|
52
|
$ok; |
1530
|
|
|
|
|
|
|
} |
1531
|
|
|
|
|
|
|
} |
1532
|
9
|
100
|
|
|
|
32
|
or do { |
1533
|
|
|
|
|
|
|
|
1534
|
|
|
|
|
|
|
package Mite::Shim; |
1535
|
4
|
100
|
66
|
|
|
58
|
( defined($to_coerce) |
1536
|
|
|
|
|
|
|
and !ref($to_coerce) |
1537
|
|
|
|
|
|
|
and $to_coerce =~ m{\A(?:[12])\z} ); |
1538
|
|
|
|
|
|
|
} |
1539
|
|
|
|
|
|
|
); |
1540
|
|
|
|
|
|
|
} |
1541
|
|
|
|
|
|
|
) |
1542
|
|
|
|
|
|
|
? $to_coerce |
1543
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
1544
|
9
|
50
|
|
|
|
26
|
do { |
|
|
100
|
|
|
|
|
|
1545
|
2
|
|
|
|
|
11
|
local $_ = $to_coerce; |
1546
|
2
|
|
|
|
|
10
|
+{ map { $_ => $_ } @$_ }; |
|
2
|
|
|
|
|
13
|
|
1547
|
|
|
|
|
|
|
} |
1548
|
|
|
|
|
|
|
) |
1549
|
|
|
|
|
|
|
: $to_coerce; |
1550
|
|
|
|
|
|
|
}; |
1551
|
9
|
50
|
|
|
|
21
|
do { |
1552
|
|
|
|
|
|
|
|
1553
|
|
|
|
|
|
|
package Mite::Shim; |
1554
|
|
|
|
|
|
|
( |
1555
|
|
|
|
|
|
|
do { |
1556
|
|
|
|
|
|
|
|
1557
|
|
|
|
|
|
|
package Mite::Shim; |
1558
|
9
|
100
|
|
|
|
76
|
( ref($coerced_value) eq 'HASH' ) and do { |
1559
|
7
|
|
|
|
|
18
|
my $ok = 1; |
1560
|
7
|
|
|
|
|
25
|
for my $v ( values %{$coerced_value} ) { |
|
7
|
|
|
|
|
28
|
|
1561
|
12
|
50
|
|
|
|
20
|
( $ok = 0, last ) unless do { |
1562
|
|
|
|
|
|
|
|
1563
|
|
|
|
|
|
|
package Mite::Shim; |
1564
|
|
|
|
|
|
|
( |
1565
|
|
|
|
|
|
|
( |
1566
|
|
|
|
|
|
|
( |
1567
|
|
|
|
|
|
|
do { |
1568
|
|
|
|
|
|
|
|
1569
|
|
|
|
|
|
|
package Mite::Shim; |
1570
|
12
|
50
|
|
|
|
38
|
defined($v) and do { |
1571
|
12
|
100
|
|
|
|
109
|
ref( \$v ) eq |
1572
|
|
|
|
|
|
|
'SCALAR' |
1573
|
|
|
|
|
|
|
or ref( |
1574
|
|
|
|
|
|
|
\( |
1575
|
|
|
|
|
|
|
my $val = |
1576
|
|
|
|
|
|
|
$v |
1577
|
|
|
|
|
|
|
) |
1578
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1579
|
|
|
|
|
|
|
} |
1580
|
|
|
|
|
|
|
} |
1581
|
|
|
|
|
|
|
) |
1582
|
|
|
|
|
|
|
&& ( |
1583
|
12
|
50
|
66
|
|
|
21
|
do { |
|
|
|
66
|
|
|
|
|
1584
|
10
|
|
|
|
|
31
|
local $_ = $v; |
1585
|
10
|
|
|
|
|
86
|
/\A[^\W0-9]\w*\z/; |
1586
|
|
|
|
|
|
|
} |
1587
|
|
|
|
|
|
|
) |
1588
|
|
|
|
|
|
|
) |
1589
|
|
|
|
|
|
|
or ( ref($v) eq 'ARRAY' ) |
1590
|
|
|
|
|
|
|
or ( ref($v) eq 'CODE' ) |
1591
|
|
|
|
|
|
|
); |
1592
|
|
|
|
|
|
|
} |
1593
|
|
|
|
|
|
|
}; |
1594
|
7
|
|
|
|
|
54
|
for my $k ( keys %{$coerced_value} ) { |
|
7
|
|
|
|
|
25
|
|
1595
|
12
|
50
|
|
|
|
37
|
( $ok = 0, last ) unless do { |
1596
|
|
|
|
|
|
|
|
1597
|
|
|
|
|
|
|
package Mite::Shim; |
1598
|
|
|
|
|
|
|
( |
1599
|
|
|
|
|
|
|
( |
1600
|
|
|
|
|
|
|
( |
1601
|
|
|
|
|
|
|
do { |
1602
|
|
|
|
|
|
|
|
1603
|
|
|
|
|
|
|
package Mite::Shim; |
1604
|
12
|
50
|
|
|
|
67
|
defined($k) and do { |
1605
|
12
|
50
|
|
|
|
91
|
ref( \$k ) eq |
1606
|
|
|
|
|
|
|
'SCALAR' |
1607
|
|
|
|
|
|
|
or ref( |
1608
|
|
|
|
|
|
|
\( |
1609
|
|
|
|
|
|
|
my $val = |
1610
|
|
|
|
|
|
|
$k |
1611
|
|
|
|
|
|
|
) |
1612
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1613
|
|
|
|
|
|
|
} |
1614
|
|
|
|
|
|
|
} |
1615
|
|
|
|
|
|
|
) |
1616
|
|
|
|
|
|
|
&& ( |
1617
|
|
|
|
|
|
|
do { |
1618
|
12
|
|
|
|
|
34
|
local $_ = $k; |
1619
|
12
|
|
|
|
|
99
|
/\A[^\W0-9]\w*\z/; |
1620
|
|
|
|
|
|
|
} |
1621
|
|
|
|
|
|
|
) |
1622
|
|
|
|
|
|
|
) |
1623
|
|
|
|
|
|
|
or ( |
1624
|
|
|
|
|
|
|
( |
1625
|
|
|
|
|
|
|
do { |
1626
|
|
|
|
|
|
|
|
1627
|
|
|
|
|
|
|
package Mite::Shim; |
1628
|
4
|
50
|
|
|
|
16
|
defined($k) and do { |
1629
|
4
|
50
|
|
|
|
31
|
ref( \$k ) eq |
1630
|
|
|
|
|
|
|
'SCALAR' |
1631
|
|
|
|
|
|
|
or ref( |
1632
|
|
|
|
|
|
|
\( |
1633
|
|
|
|
|
|
|
my $val = |
1634
|
|
|
|
|
|
|
$k |
1635
|
|
|
|
|
|
|
) |
1636
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1637
|
|
|
|
|
|
|
} |
1638
|
|
|
|
|
|
|
} |
1639
|
|
|
|
|
|
|
) |
1640
|
12
|
100
|
33
|
|
|
23
|
&& ( do { local $_ = $k; /\%/ } |
|
4
|
|
66
|
|
|
14
|
|
|
4
|
|
|
|
|
25
|
|
1641
|
|
|
|
|
|
|
) |
1642
|
|
|
|
|
|
|
) |
1643
|
|
|
|
|
|
|
); |
1644
|
|
|
|
|
|
|
} |
1645
|
|
|
|
|
|
|
}; |
1646
|
7
|
|
|
|
|
51
|
$ok; |
1647
|
|
|
|
|
|
|
} |
1648
|
|
|
|
|
|
|
} |
1649
|
9
|
100
|
|
|
|
19
|
or do { |
1650
|
|
|
|
|
|
|
|
1651
|
|
|
|
|
|
|
package Mite::Shim; |
1652
|
2
|
50
|
33
|
|
|
34
|
( defined($coerced_value) |
1653
|
|
|
|
|
|
|
and !ref($coerced_value) |
1654
|
|
|
|
|
|
|
and $coerced_value =~ m{\A(?:[12])\z} ); |
1655
|
|
|
|
|
|
|
} |
1656
|
|
|
|
|
|
|
); |
1657
|
|
|
|
|
|
|
} |
1658
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
1659
|
|
|
|
|
|
|
"handles", "HandlesHash|Enum[\"1\",\"2\"]"; |
1660
|
9
|
|
|
|
|
40
|
$self->{"handles"} = $coerced_value; |
1661
|
|
|
|
|
|
|
}; |
1662
|
|
|
|
|
|
|
} |
1663
|
|
|
|
|
|
|
|
1664
|
|
|
|
|
|
|
# Attribute handles_via (type: ArrayRef[Str]) |
1665
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 160 |
1666
|
173
|
100
|
|
|
|
577
|
if ( exists $args->{"handles_via"} ) { |
1667
|
3
|
|
|
|
|
5
|
do { |
1668
|
3
|
|
|
|
|
16
|
my $coerced_value = do { |
1669
|
3
|
|
|
|
|
22
|
my $to_coerce = $args->{"handles_via"}; |
1670
|
|
|
|
|
|
|
( |
1671
|
|
|
|
|
|
|
do { |
1672
|
|
|
|
|
|
|
|
1673
|
|
|
|
|
|
|
package Mite::Shim; |
1674
|
3
|
50
|
|
|
|
20
|
( ref($to_coerce) eq 'ARRAY' ) and do { |
1675
|
0
|
|
|
|
|
0
|
my $ok = 1; |
1676
|
0
|
|
|
|
|
0
|
for my $i ( @{$to_coerce} ) { |
|
0
|
|
|
|
|
0
|
|
1677
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
1678
|
|
|
|
|
|
|
|
1679
|
|
|
|
|
|
|
package Mite::Shim; |
1680
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
1681
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
1682
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
1683
|
|
|
|
|
|
|
'SCALAR'; |
1684
|
|
|
|
|
|
|
} |
1685
|
|
|
|
|
|
|
} |
1686
|
|
|
|
|
|
|
}; |
1687
|
0
|
|
|
|
|
0
|
$ok; |
1688
|
|
|
|
|
|
|
} |
1689
|
|
|
|
|
|
|
} |
1690
|
|
|
|
|
|
|
) ? $to_coerce : ( |
1691
|
|
|
|
|
|
|
do { |
1692
|
|
|
|
|
|
|
|
1693
|
|
|
|
|
|
|
package Mite::Shim; |
1694
|
3
|
50
|
|
|
|
21
|
defined($to_coerce) and do { |
1695
|
3
|
50
|
|
|
|
24
|
ref( \$to_coerce ) eq 'SCALAR' |
1696
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq |
1697
|
|
|
|
|
|
|
'SCALAR'; |
1698
|
|
|
|
|
|
|
} |
1699
|
|
|
|
|
|
|
} |
1700
|
|
|
|
|
|
|
) |
1701
|
3
|
50
|
|
|
|
7
|
? scalar( do { local $_ = $to_coerce; [$_] } ) |
|
3
|
50
|
|
|
|
16
|
|
|
3
|
|
|
|
|
11
|
|
1702
|
|
|
|
|
|
|
: $to_coerce; |
1703
|
|
|
|
|
|
|
}; |
1704
|
3
|
50
|
|
|
|
5
|
do { |
1705
|
|
|
|
|
|
|
|
1706
|
|
|
|
|
|
|
package Mite::Shim; |
1707
|
3
|
50
|
|
|
|
14
|
( ref($coerced_value) eq 'ARRAY' ) and do { |
1708
|
3
|
|
|
|
|
8
|
my $ok = 1; |
1709
|
3
|
|
|
|
|
20
|
for my $i ( @{$coerced_value} ) { |
|
3
|
|
|
|
|
9
|
|
1710
|
3
|
50
|
|
|
|
7
|
( $ok = 0, last ) unless do { |
1711
|
|
|
|
|
|
|
|
1712
|
|
|
|
|
|
|
package Mite::Shim; |
1713
|
3
|
50
|
|
|
|
18
|
defined($i) and do { |
1714
|
3
|
50
|
|
|
|
31
|
ref( \$i ) eq 'SCALAR' |
1715
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq 'SCALAR'; |
1716
|
|
|
|
|
|
|
} |
1717
|
|
|
|
|
|
|
} |
1718
|
|
|
|
|
|
|
}; |
1719
|
3
|
|
|
|
|
36
|
$ok; |
1720
|
|
|
|
|
|
|
} |
1721
|
|
|
|
|
|
|
} |
1722
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
1723
|
|
|
|
|
|
|
"handles_via", "ArrayRef[Str]"; |
1724
|
3
|
|
|
|
|
12
|
$self->{"handles_via"} = $coerced_value; |
1725
|
|
|
|
|
|
|
}; |
1726
|
|
|
|
|
|
|
} |
1727
|
|
|
|
|
|
|
|
1728
|
|
|
|
|
|
|
# Attribute alias (type: AliasList) |
1729
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 170 |
1730
|
173
|
|
|
|
|
336
|
do { |
1731
|
|
|
|
|
|
|
my $value = |
1732
|
|
|
|
|
|
|
exists( $args->{"alias"} ) |
1733
|
173
|
100
|
|
|
|
1313
|
? $args->{"alias"} |
1734
|
|
|
|
|
|
|
: $Mite::Attribute::__alias_DEFAULT__->($self); |
1735
|
173
|
|
|
|
|
397
|
do { |
1736
|
173
|
|
|
|
|
360
|
my $coerced_value = do { |
1737
|
173
|
|
|
|
|
441
|
my $to_coerce = $value; |
1738
|
|
|
|
|
|
|
( |
1739
|
|
|
|
|
|
|
do { |
1740
|
|
|
|
|
|
|
|
1741
|
|
|
|
|
|
|
package Mite::Shim; |
1742
|
173
|
100
|
|
|
|
980
|
( ref($to_coerce) eq 'ARRAY' ) and do { |
1743
|
171
|
|
|
|
|
391
|
my $ok = 1; |
1744
|
171
|
|
|
|
|
422
|
for my $i ( @{$to_coerce} ) { |
|
171
|
|
|
|
|
676
|
|
1745
|
2
|
50
|
|
|
|
3
|
( $ok = 0, last ) unless do { |
1746
|
|
|
|
|
|
|
|
1747
|
|
|
|
|
|
|
package Mite::Shim; |
1748
|
|
|
|
|
|
|
( |
1749
|
|
|
|
|
|
|
( |
1750
|
|
|
|
|
|
|
( |
1751
|
|
|
|
|
|
|
do { |
1752
|
|
|
|
|
|
|
|
1753
|
|
|
|
|
|
|
package Mite::Shim; |
1754
|
2
|
50
|
|
|
|
18
|
defined($i) and do { |
1755
|
2
|
50
|
|
|
|
15
|
ref( \$i ) eq |
1756
|
|
|
|
|
|
|
'SCALAR' |
1757
|
|
|
|
|
|
|
or ref( |
1758
|
|
|
|
|
|
|
\( |
1759
|
|
|
|
|
|
|
my $val = |
1760
|
|
|
|
|
|
|
$i |
1761
|
|
|
|
|
|
|
) |
1762
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1763
|
|
|
|
|
|
|
} |
1764
|
|
|
|
|
|
|
} |
1765
|
|
|
|
|
|
|
) |
1766
|
|
|
|
|
|
|
&& ( |
1767
|
|
|
|
|
|
|
do { |
1768
|
2
|
|
|
|
|
12
|
local $_ = $i; |
1769
|
2
|
|
|
|
|
17
|
/\A[^\W0-9]\w*\z/; |
1770
|
|
|
|
|
|
|
} |
1771
|
|
|
|
|
|
|
) |
1772
|
|
|
|
|
|
|
) |
1773
|
|
|
|
|
|
|
or ( |
1774
|
|
|
|
|
|
|
( |
1775
|
|
|
|
|
|
|
do { |
1776
|
|
|
|
|
|
|
|
1777
|
|
|
|
|
|
|
package Mite::Shim; |
1778
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
1779
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq |
1780
|
|
|
|
|
|
|
'SCALAR' |
1781
|
|
|
|
|
|
|
or ref( |
1782
|
|
|
|
|
|
|
\( |
1783
|
|
|
|
|
|
|
my $val = |
1784
|
|
|
|
|
|
|
$i |
1785
|
|
|
|
|
|
|
) |
1786
|
|
|
|
|
|
|
) eq 'SCALAR'; |
1787
|
|
|
|
|
|
|
} |
1788
|
|
|
|
|
|
|
} |
1789
|
|
|
|
|
|
|
) |
1790
|
2
|
50
|
0
|
|
|
5
|
&& ( do { local $_ = $i; /\%/ } |
|
0
|
|
33
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1791
|
|
|
|
|
|
|
) |
1792
|
|
|
|
|
|
|
) |
1793
|
|
|
|
|
|
|
); |
1794
|
|
|
|
|
|
|
} |
1795
|
|
|
|
|
|
|
}; |
1796
|
171
|
|
|
|
|
911
|
$ok; |
1797
|
|
|
|
|
|
|
} |
1798
|
|
|
|
|
|
|
} |
1799
|
|
|
|
|
|
|
) ? $to_coerce : ( |
1800
|
|
|
|
|
|
|
do { |
1801
|
|
|
|
|
|
|
|
1802
|
|
|
|
|
|
|
package Mite::Shim; |
1803
|
2
|
100
|
|
|
|
10
|
defined($to_coerce) and do { |
1804
|
1
|
50
|
|
|
|
7
|
ref( \$to_coerce ) eq 'SCALAR' |
1805
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq |
1806
|
|
|
|
|
|
|
'SCALAR'; |
1807
|
|
|
|
|
|
|
} |
1808
|
|
|
|
|
|
|
} |
1809
|
1
|
|
|
|
|
2
|
) ? scalar( do { local $_ = $to_coerce; [$_] } ) |
|
1
|
|
|
|
|
4
|
|
1810
|
|
|
|
|
|
|
: ( ( !defined($to_coerce) ) ) |
1811
|
173
|
50
|
|
|
|
410
|
? scalar( do { local $_ = $to_coerce; [] } ) |
|
1
|
100
|
|
|
|
10
|
|
|
1
|
100
|
|
|
|
4
|
|
1812
|
|
|
|
|
|
|
: $to_coerce; |
1813
|
|
|
|
|
|
|
}; |
1814
|
173
|
50
|
|
|
|
374
|
do { |
1815
|
|
|
|
|
|
|
|
1816
|
|
|
|
|
|
|
package Mite::Shim; |
1817
|
173
|
50
|
|
|
|
938
|
( ref($coerced_value) eq 'ARRAY' ) and do { |
1818
|
173
|
|
|
|
|
376
|
my $ok = 1; |
1819
|
173
|
|
|
|
|
387
|
for my $i ( @{$coerced_value} ) { |
|
173
|
|
|
|
|
609
|
|
1820
|
3
|
50
|
|
|
|
5
|
( $ok = 0, last ) unless do { |
1821
|
|
|
|
|
|
|
|
1822
|
|
|
|
|
|
|
package Mite::Shim; |
1823
|
|
|
|
|
|
|
( |
1824
|
|
|
|
|
|
|
( |
1825
|
|
|
|
|
|
|
( |
1826
|
|
|
|
|
|
|
do { |
1827
|
|
|
|
|
|
|
|
1828
|
|
|
|
|
|
|
package Mite::Shim; |
1829
|
3
|
50
|
|
|
|
10
|
defined($i) and do { |
1830
|
3
|
50
|
|
|
|
14
|
ref( \$i ) eq 'SCALAR' |
1831
|
|
|
|
|
|
|
or |
1832
|
|
|
|
|
|
|
ref( \( my $val = $i ) ) |
1833
|
|
|
|
|
|
|
eq 'SCALAR'; |
1834
|
|
|
|
|
|
|
} |
1835
|
|
|
|
|
|
|
} |
1836
|
|
|
|
|
|
|
) |
1837
|
|
|
|
|
|
|
&& ( |
1838
|
|
|
|
|
|
|
do { |
1839
|
3
|
|
|
|
|
6
|
local $_ = $i; |
1840
|
3
|
|
|
|
|
19
|
/\A[^\W0-9]\w*\z/; |
1841
|
|
|
|
|
|
|
} |
1842
|
|
|
|
|
|
|
) |
1843
|
|
|
|
|
|
|
) |
1844
|
|
|
|
|
|
|
or ( |
1845
|
|
|
|
|
|
|
( |
1846
|
|
|
|
|
|
|
do { |
1847
|
|
|
|
|
|
|
|
1848
|
|
|
|
|
|
|
package Mite::Shim; |
1849
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
1850
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
1851
|
|
|
|
|
|
|
or |
1852
|
|
|
|
|
|
|
ref( \( my $val = $i ) ) |
1853
|
|
|
|
|
|
|
eq 'SCALAR'; |
1854
|
|
|
|
|
|
|
} |
1855
|
|
|
|
|
|
|
} |
1856
|
|
|
|
|
|
|
) |
1857
|
3
|
50
|
0
|
|
|
14
|
&& ( do { local $_ = $i; /\%/ } ) |
|
0
|
|
33
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1858
|
|
|
|
|
|
|
) |
1859
|
|
|
|
|
|
|
); |
1860
|
|
|
|
|
|
|
} |
1861
|
|
|
|
|
|
|
}; |
1862
|
173
|
|
|
|
|
707
|
$ok; |
1863
|
|
|
|
|
|
|
} |
1864
|
|
|
|
|
|
|
} |
1865
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
1866
|
|
|
|
|
|
|
"alias", "AliasList"; |
1867
|
173
|
|
|
|
|
733
|
$self->{"alias"} = $coerced_value; |
1868
|
|
|
|
|
|
|
}; |
1869
|
|
|
|
|
|
|
}; |
1870
|
|
|
|
|
|
|
|
1871
|
|
|
|
|
|
|
# Call BUILD methods |
1872
|
173
|
50
|
33
|
|
|
905
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
|
173
|
50
|
|
|
|
1526
|
|
1873
|
|
|
|
|
|
|
|
1874
|
|
|
|
|
|
|
# Unrecognized parameters |
1875
|
|
|
|
|
|
|
my @unknown = grep not( |
1876
|
|
|
|
|
|
|
/\A(?:_class_for_default|a(?:ccessor|lias)|builder|c(?:l(?:ass|earer|one(?:_on_(?:read|write))?)|o(?:deref_default_variable|erce))|d(?:ef(?:ault(?:_(?:does_trigger|is_trusted))?|inition_context)|o(?:cumentation|es))|enum|handles(?:_via)?|i(?:nit_arg|sa?)|l(?:azy|oc(?:al_writer|ked)|value)|name|predicate|re(?:ader|quired)|skip_argc_check|t(?:rigger|ype)|w(?:eak_ref|riter))\z/ |
1877
|
165
|
|
|
|
|
398
|
), keys %{$args}; |
|
165
|
|
|
|
|
2999
|
|
1878
|
|
|
|
|
|
|
@unknown |
1879
|
165
|
50
|
|
|
|
746
|
and croak( |
1880
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
1881
|
|
|
|
|
|
|
|
1882
|
165
|
|
|
|
|
1239
|
return $self; |
1883
|
|
|
|
|
|
|
} |
1884
|
|
|
|
|
|
|
|
1885
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
1886
|
|
|
|
|
|
|
sub BUILDALL { |
1887
|
173
|
|
|
173
|
0
|
646
|
my $class = ref( $_[0] ); |
1888
|
173
|
|
33
|
|
|
991
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
1889
|
173
|
50
|
|
|
|
415
|
$_->(@_) for @{ $meta->{BUILD} || [] }; |
|
173
|
|
|
|
|
1537
|
|
1890
|
|
|
|
|
|
|
} |
1891
|
|
|
|
|
|
|
|
1892
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
1893
|
|
|
|
|
|
|
sub DESTROY { |
1894
|
50
|
|
|
50
|
|
17721
|
my $self = shift; |
1895
|
50
|
|
33
|
|
|
223
|
my $class = ref($self) || $self; |
1896
|
50
|
|
33
|
|
|
204
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
1897
|
50
|
50
|
|
|
|
261
|
my $in_global_destruction = |
1898
|
|
|
|
|
|
|
defined ${^GLOBAL_PHASE} |
1899
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
1900
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
1901
|
50
|
50
|
|
|
|
96
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
50
|
|
|
|
|
204
|
|
1902
|
0
|
|
|
|
|
0
|
my $e = do { |
1903
|
0
|
|
|
|
|
0
|
local ( $?, $@ ); |
1904
|
0
|
|
|
|
|
0
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
|
0
|
|
|
|
|
0
|
|
1905
|
0
|
|
|
|
|
0
|
$@; |
1906
|
|
|
|
|
|
|
}; |
1907
|
79
|
|
|
79
|
|
757
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
79
|
|
|
|
|
280
|
|
|
79
|
|
|
|
|
796976
|
|
1908
|
0
|
0
|
|
|
|
0
|
die $e if $e; # rethrow |
1909
|
|
|
|
|
|
|
} |
1910
|
50
|
|
|
|
|
9811
|
return; |
1911
|
|
|
|
|
|
|
} |
1912
|
|
|
|
|
|
|
|
1913
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} |
1914
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
1915
|
|
|
|
|
|
|
|
1916
|
|
|
|
|
|
|
# Accessors for _class_for_default |
1917
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 41 |
1918
|
|
|
|
|
|
|
sub _class_for_default { |
1919
|
|
|
|
|
|
|
@_ > 1 |
1920
|
|
|
|
|
|
|
? do { |
1921
|
0
|
0
|
0
|
|
|
0
|
blessed( $_[1] ) && $_[1]->isa("Mite::Package") |
1922
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
1923
|
|
|
|
|
|
|
"accessor", "Mite::Package" ); |
1924
|
0
|
|
|
|
|
0
|
$_[0]{"_class_for_default"} = $_[1]; |
1925
|
|
|
|
|
|
|
require Scalar::Util |
1926
|
|
|
|
|
|
|
&& Scalar::Util::weaken( $_[0]{"_class_for_default"} ) |
1927
|
0
|
0
|
0
|
|
|
0
|
if ref $_[0]{"_class_for_default"}; |
1928
|
0
|
|
|
|
|
0
|
$_[0]; |
1929
|
|
|
|
|
|
|
} |
1930
|
27
|
50
|
|
27
|
|
129
|
: do { |
1931
|
|
|
|
|
|
|
( |
1932
|
|
|
|
|
|
|
exists( $_[0]{"_class_for_default"} ) |
1933
|
|
|
|
|
|
|
? $_[0]{"_class_for_default"} |
1934
|
|
|
|
|
|
|
: ( |
1935
|
27
|
100
|
|
|
|
118
|
$_[0]{"_class_for_default"} = do { |
1936
|
26
|
|
|
|
|
138
|
my $default_value = $_[0]->_build__class_for_default; |
1937
|
26
|
50
|
33
|
|
|
286
|
blessed($default_value) |
1938
|
|
|
|
|
|
|
&& $default_value->isa("Mite::Package") |
1939
|
|
|
|
|
|
|
or croak( |
1940
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
1941
|
|
|
|
|
|
|
"_class_for_default", |
1942
|
|
|
|
|
|
|
"Mite::Package" |
1943
|
|
|
|
|
|
|
); |
1944
|
26
|
|
|
|
|
233
|
$default_value; |
1945
|
|
|
|
|
|
|
} |
1946
|
|
|
|
|
|
|
) |
1947
|
|
|
|
|
|
|
) |
1948
|
|
|
|
|
|
|
} |
1949
|
|
|
|
|
|
|
} |
1950
|
|
|
|
|
|
|
|
1951
|
|
|
|
|
|
|
# Accessors for _order |
1952
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 18 |
1953
|
|
|
|
|
|
|
if ($__XS) { |
1954
|
|
|
|
|
|
|
Class::XSAccessor->import( |
1955
|
|
|
|
|
|
|
chained => 1, |
1956
|
|
|
|
|
|
|
"accessors" => { "_order" => "_order" }, |
1957
|
|
|
|
|
|
|
); |
1958
|
|
|
|
|
|
|
} |
1959
|
|
|
|
|
|
|
else { |
1960
|
|
|
|
|
|
|
*_order = sub { |
1961
|
|
|
|
|
|
|
@_ > 1 |
1962
|
|
|
|
|
|
|
? do { $_[0]{"_order"} = $_[1]; $_[0]; } |
1963
|
|
|
|
|
|
|
: ( $_[0]{"_order"} ); |
1964
|
|
|
|
|
|
|
}; |
1965
|
|
|
|
|
|
|
} |
1966
|
|
|
|
|
|
|
|
1967
|
|
|
|
|
|
|
# Accessors for accessor |
1968
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
1969
|
|
|
|
|
|
|
sub accessor { |
1970
|
|
|
|
|
|
|
@_ > 1 |
1971
|
|
|
|
|
|
|
? do { |
1972
|
4
|
50
|
|
|
|
11
|
do { |
1973
|
|
|
|
|
|
|
|
1974
|
|
|
|
|
|
|
package Mite::Shim; |
1975
|
|
|
|
|
|
|
( |
1976
|
|
|
|
|
|
|
do { |
1977
|
|
|
|
|
|
|
|
1978
|
|
|
|
|
|
|
package Mite::Shim; |
1979
|
|
|
|
|
|
|
( |
1980
|
|
|
|
|
|
|
( |
1981
|
|
|
|
|
|
|
( |
1982
|
|
|
|
|
|
|
do { |
1983
|
|
|
|
|
|
|
|
1984
|
|
|
|
|
|
|
package Mite::Shim; |
1985
|
4
|
50
|
|
|
|
52
|
defined( $_[1] ) and do { |
1986
|
4
|
50
|
|
|
|
82
|
ref( \$_[1] ) eq 'SCALAR' |
1987
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
1988
|
|
|
|
|
|
|
'SCALAR'; |
1989
|
|
|
|
|
|
|
} |
1990
|
|
|
|
|
|
|
} |
1991
|
|
|
|
|
|
|
) |
1992
|
|
|
|
|
|
|
&& ( |
1993
|
4
|
|
|
|
|
19
|
do { local $_ = $_[1]; /\A[^\W0-9]\w*\z/ } |
|
4
|
|
|
|
|
85
|
|
1994
|
|
|
|
|
|
|
) |
1995
|
|
|
|
|
|
|
) |
1996
|
|
|
|
|
|
|
or ( |
1997
|
|
|
|
|
|
|
( |
1998
|
|
|
|
|
|
|
do { |
1999
|
|
|
|
|
|
|
|
2000
|
|
|
|
|
|
|
package Mite::Shim; |
2001
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
2002
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
2003
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
2004
|
|
|
|
|
|
|
'SCALAR'; |
2005
|
|
|
|
|
|
|
} |
2006
|
|
|
|
|
|
|
} |
2007
|
|
|
|
|
|
|
) |
2008
|
|
|
|
|
|
|
&& ( |
2009
|
4
|
50
|
0
|
|
|
11
|
do { local $_ = $_[1]; /\%/ } |
|
0
|
|
33
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
2010
|
|
|
|
|
|
|
) |
2011
|
|
|
|
|
|
|
) |
2012
|
|
|
|
|
|
|
); |
2013
|
|
|
|
|
|
|
} |
2014
|
4
|
0
|
33
|
|
|
43
|
or do { |
2015
|
|
|
|
|
|
|
|
2016
|
|
|
|
|
|
|
package Mite::Shim; |
2017
|
0
|
0
|
0
|
|
|
0
|
( defined( $_[1] ) |
2018
|
|
|
|
|
|
|
and !ref( $_[1] ) |
2019
|
|
|
|
|
|
|
and $_[1] =~ m{\A(?:1)\z} ); |
2020
|
|
|
|
|
|
|
} |
2021
|
|
|
|
|
|
|
or ( !defined( $_[1] ) ) |
2022
|
|
|
|
|
|
|
); |
2023
|
|
|
|
|
|
|
} |
2024
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2025
|
|
|
|
|
|
|
"accessor", "MethodNameTemplate|One|Undef" ); |
2026
|
4
|
|
|
|
|
22
|
$_[0]{"accessor"} = $_[1]; |
2027
|
4
|
|
|
|
|
25
|
$_[0]; |
2028
|
|
|
|
|
|
|
} |
2029
|
312
|
100
|
|
312
|
0
|
1077
|
: do { |
2030
|
|
|
|
|
|
|
( |
2031
|
|
|
|
|
|
|
exists( $_[0]{"accessor"} ) ? $_[0]{"accessor"} : ( |
2032
|
308
|
100
|
|
|
|
1059
|
$_[0]{"accessor"} = do { |
2033
|
162
|
|
|
|
|
664
|
my $default_value = $_[0]->_build_accessor; |
2034
|
162
|
50
|
|
|
|
358
|
do { |
2035
|
|
|
|
|
|
|
|
2036
|
|
|
|
|
|
|
package Mite::Shim; |
2037
|
|
|
|
|
|
|
( |
2038
|
|
|
|
|
|
|
do { |
2039
|
|
|
|
|
|
|
|
2040
|
|
|
|
|
|
|
package Mite::Shim; |
2041
|
|
|
|
|
|
|
( |
2042
|
|
|
|
|
|
|
( |
2043
|
|
|
|
|
|
|
( |
2044
|
|
|
|
|
|
|
do { |
2045
|
|
|
|
|
|
|
|
2046
|
|
|
|
|
|
|
package Mite::Shim; |
2047
|
|
|
|
|
|
|
defined($default_value) |
2048
|
162
|
100
|
|
|
|
1134
|
and do { |
2049
|
60
|
50
|
|
|
|
561
|
ref( \$default_value ) |
2050
|
|
|
|
|
|
|
eq 'SCALAR' |
2051
|
|
|
|
|
|
|
or ref( |
2052
|
|
|
|
|
|
|
\( |
2053
|
|
|
|
|
|
|
my $val = |
2054
|
|
|
|
|
|
|
$default_value |
2055
|
|
|
|
|
|
|
) |
2056
|
|
|
|
|
|
|
) eq 'SCALAR'; |
2057
|
|
|
|
|
|
|
} |
2058
|
|
|
|
|
|
|
} |
2059
|
|
|
|
|
|
|
) |
2060
|
|
|
|
|
|
|
&& ( |
2061
|
|
|
|
|
|
|
do { |
2062
|
60
|
|
|
|
|
162
|
local $_ = $default_value; |
2063
|
60
|
|
|
|
|
585
|
/\A[^\W0-9]\w*\z/; |
2064
|
|
|
|
|
|
|
} |
2065
|
|
|
|
|
|
|
) |
2066
|
|
|
|
|
|
|
) |
2067
|
|
|
|
|
|
|
or ( |
2068
|
|
|
|
|
|
|
( |
2069
|
|
|
|
|
|
|
do { |
2070
|
|
|
|
|
|
|
|
2071
|
|
|
|
|
|
|
package Mite::Shim; |
2072
|
|
|
|
|
|
|
defined($default_value) |
2073
|
162
|
100
|
|
|
|
1316
|
and do { |
2074
|
60
|
50
|
|
|
|
529
|
ref( \$default_value ) |
2075
|
|
|
|
|
|
|
eq 'SCALAR' |
2076
|
|
|
|
|
|
|
or ref( |
2077
|
|
|
|
|
|
|
\( |
2078
|
|
|
|
|
|
|
my $val = |
2079
|
|
|
|
|
|
|
$default_value |
2080
|
|
|
|
|
|
|
) |
2081
|
|
|
|
|
|
|
) eq 'SCALAR'; |
2082
|
|
|
|
|
|
|
} |
2083
|
|
|
|
|
|
|
} |
2084
|
|
|
|
|
|
|
) |
2085
|
|
|
|
|
|
|
&& ( |
2086
|
162
|
50
|
66
|
|
|
320
|
do { |
|
|
|
66
|
|
|
|
|
2087
|
60
|
|
|
|
|
156
|
local $_ = $default_value; |
2088
|
60
|
|
|
|
|
626
|
/\%/; |
2089
|
|
|
|
|
|
|
} |
2090
|
|
|
|
|
|
|
) |
2091
|
|
|
|
|
|
|
) |
2092
|
|
|
|
|
|
|
); |
2093
|
|
|
|
|
|
|
} |
2094
|
162
|
50
|
66
|
|
|
335
|
or do { |
2095
|
|
|
|
|
|
|
|
2096
|
|
|
|
|
|
|
package Mite::Shim; |
2097
|
102
|
50
|
33
|
|
|
886
|
( defined($default_value) |
2098
|
|
|
|
|
|
|
and !ref($default_value) |
2099
|
|
|
|
|
|
|
and $default_value =~ m{\A(?:1)\z} ); |
2100
|
|
|
|
|
|
|
} |
2101
|
|
|
|
|
|
|
or ( !defined($default_value) ) |
2102
|
|
|
|
|
|
|
); |
2103
|
|
|
|
|
|
|
} |
2104
|
|
|
|
|
|
|
or croak( |
2105
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
2106
|
|
|
|
|
|
|
"accessor", |
2107
|
|
|
|
|
|
|
"MethodNameTemplate|One|Undef" |
2108
|
|
|
|
|
|
|
); |
2109
|
162
|
|
|
|
|
760
|
$default_value; |
2110
|
|
|
|
|
|
|
} |
2111
|
|
|
|
|
|
|
) |
2112
|
|
|
|
|
|
|
) |
2113
|
|
|
|
|
|
|
} |
2114
|
|
|
|
|
|
|
} |
2115
|
|
|
|
|
|
|
|
2116
|
|
|
|
|
|
|
# Accessors for alias |
2117
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 170 |
2118
|
|
|
|
|
|
|
sub alias { |
2119
|
|
|
|
|
|
|
@_ > 1 |
2120
|
|
|
|
|
|
|
? do { |
2121
|
0
|
|
|
|
|
0
|
my $value = do { |
2122
|
0
|
|
|
|
|
0
|
my $to_coerce = $_[1]; |
2123
|
|
|
|
|
|
|
( |
2124
|
|
|
|
|
|
|
do { |
2125
|
|
|
|
|
|
|
|
2126
|
|
|
|
|
|
|
package Mite::Shim; |
2127
|
0
|
0
|
|
|
|
0
|
( ref($to_coerce) eq 'ARRAY' ) and do { |
2128
|
0
|
|
|
|
|
0
|
my $ok = 1; |
2129
|
0
|
|
|
|
|
0
|
for my $i ( @{$to_coerce} ) { |
|
0
|
|
|
|
|
0
|
|
2130
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
2131
|
|
|
|
|
|
|
|
2132
|
|
|
|
|
|
|
package Mite::Shim; |
2133
|
|
|
|
|
|
|
( |
2134
|
|
|
|
|
|
|
( |
2135
|
|
|
|
|
|
|
( |
2136
|
|
|
|
|
|
|
do { |
2137
|
|
|
|
|
|
|
|
2138
|
|
|
|
|
|
|
package Mite::Shim; |
2139
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
2140
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
2141
|
|
|
|
|
|
|
or ref( |
2142
|
|
|
|
|
|
|
\( my $val = $i ) ) |
2143
|
|
|
|
|
|
|
eq 'SCALAR'; |
2144
|
|
|
|
|
|
|
} |
2145
|
|
|
|
|
|
|
} |
2146
|
|
|
|
|
|
|
) |
2147
|
|
|
|
|
|
|
&& ( |
2148
|
|
|
|
|
|
|
do { |
2149
|
0
|
|
|
|
|
0
|
local $_ = $i; |
2150
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*\z/; |
2151
|
|
|
|
|
|
|
} |
2152
|
|
|
|
|
|
|
) |
2153
|
|
|
|
|
|
|
) |
2154
|
|
|
|
|
|
|
or ( |
2155
|
|
|
|
|
|
|
( |
2156
|
|
|
|
|
|
|
do { |
2157
|
|
|
|
|
|
|
|
2158
|
|
|
|
|
|
|
package Mite::Shim; |
2159
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
2160
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
2161
|
|
|
|
|
|
|
or ref( |
2162
|
|
|
|
|
|
|
\( my $val = $i ) ) |
2163
|
|
|
|
|
|
|
eq 'SCALAR'; |
2164
|
|
|
|
|
|
|
} |
2165
|
|
|
|
|
|
|
} |
2166
|
|
|
|
|
|
|
) |
2167
|
0
|
0
|
0
|
|
|
0
|
&& ( do { local $_ = $i; /\%/ } ) |
|
0
|
|
0
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
2168
|
|
|
|
|
|
|
) |
2169
|
|
|
|
|
|
|
); |
2170
|
|
|
|
|
|
|
} |
2171
|
|
|
|
|
|
|
}; |
2172
|
0
|
|
|
|
|
0
|
$ok; |
2173
|
|
|
|
|
|
|
} |
2174
|
|
|
|
|
|
|
} |
2175
|
|
|
|
|
|
|
) ? $to_coerce : ( |
2176
|
|
|
|
|
|
|
do { |
2177
|
|
|
|
|
|
|
|
2178
|
|
|
|
|
|
|
package Mite::Shim; |
2179
|
0
|
0
|
|
|
|
0
|
defined($to_coerce) and do { |
2180
|
0
|
0
|
|
|
|
0
|
ref( \$to_coerce ) eq 'SCALAR' |
2181
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq 'SCALAR'; |
2182
|
|
|
|
|
|
|
} |
2183
|
|
|
|
|
|
|
} |
2184
|
0
|
|
|
|
|
0
|
) ? scalar( do { local $_ = $to_coerce; [$_] } ) |
|
0
|
|
|
|
|
0
|
|
2185
|
|
|
|
|
|
|
: ( ( !defined($to_coerce) ) ) |
2186
|
0
|
0
|
|
|
|
0
|
? scalar( do { local $_ = $to_coerce; [] } ) |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
2187
|
|
|
|
|
|
|
: $to_coerce; |
2188
|
|
|
|
|
|
|
}; |
2189
|
0
|
0
|
|
|
|
0
|
do { |
2190
|
|
|
|
|
|
|
|
2191
|
|
|
|
|
|
|
package Mite::Shim; |
2192
|
0
|
0
|
|
|
|
0
|
( ref($value) eq 'ARRAY' ) and do { |
2193
|
0
|
|
|
|
|
0
|
my $ok = 1; |
2194
|
0
|
|
|
|
|
0
|
for my $i ( @{$value} ) { |
|
0
|
|
|
|
|
0
|
|
2195
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
2196
|
|
|
|
|
|
|
|
2197
|
|
|
|
|
|
|
package Mite::Shim; |
2198
|
|
|
|
|
|
|
( |
2199
|
|
|
|
|
|
|
( |
2200
|
|
|
|
|
|
|
( |
2201
|
|
|
|
|
|
|
do { |
2202
|
|
|
|
|
|
|
|
2203
|
|
|
|
|
|
|
package Mite::Shim; |
2204
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
2205
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
2206
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) |
2207
|
|
|
|
|
|
|
eq 'SCALAR'; |
2208
|
|
|
|
|
|
|
} |
2209
|
|
|
|
|
|
|
} |
2210
|
|
|
|
|
|
|
) |
2211
|
|
|
|
|
|
|
&& ( |
2212
|
0
|
|
|
|
|
0
|
do { local $_ = $i; /\A[^\W0-9]\w*\z/ } |
|
0
|
|
|
|
|
0
|
|
2213
|
|
|
|
|
|
|
) |
2214
|
|
|
|
|
|
|
) |
2215
|
|
|
|
|
|
|
or ( |
2216
|
|
|
|
|
|
|
( |
2217
|
|
|
|
|
|
|
do { |
2218
|
|
|
|
|
|
|
|
2219
|
|
|
|
|
|
|
package Mite::Shim; |
2220
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
2221
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
2222
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) |
2223
|
|
|
|
|
|
|
eq 'SCALAR'; |
2224
|
|
|
|
|
|
|
} |
2225
|
|
|
|
|
|
|
} |
2226
|
|
|
|
|
|
|
) |
2227
|
0
|
0
|
0
|
|
|
0
|
&& ( do { local $_ = $i; /\%/ } ) |
|
0
|
|
0
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
2228
|
|
|
|
|
|
|
) |
2229
|
|
|
|
|
|
|
); |
2230
|
|
|
|
|
|
|
} |
2231
|
|
|
|
|
|
|
}; |
2232
|
0
|
|
|
|
|
0
|
$ok; |
2233
|
|
|
|
|
|
|
} |
2234
|
|
|
|
|
|
|
} |
2235
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2236
|
|
|
|
|
|
|
"accessor", "AliasList" ); |
2237
|
0
|
|
|
|
|
0
|
$_[0]{"alias"} = $value; |
2238
|
0
|
|
|
|
|
0
|
$_[0]; |
2239
|
|
|
|
|
|
|
} |
2240
|
496
|
50
|
|
496
|
0
|
3017
|
: ( $_[0]{"alias"} ); |
2241
|
|
|
|
|
|
|
} |
2242
|
|
|
|
|
|
|
|
2243
|
|
|
|
|
|
|
# Accessors for alias_is_for |
2244
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 172 |
2245
|
|
|
|
|
|
|
sub alias_is_for { |
2246
|
119
|
50
|
|
119
|
0
|
516
|
@_ == 1 or croak('Reader "alias_is_for" usage: $self->alias_is_for()'); |
2247
|
|
|
|
|
|
|
( |
2248
|
|
|
|
|
|
|
exists( $_[0]{"alias_is_for"} ) |
2249
|
|
|
|
|
|
|
? $_[0]{"alias_is_for"} |
2250
|
119
|
50
|
|
|
|
771
|
: ( $_[0]{"alias_is_for"} = $_[0]->_build_alias_is_for ) ); |
2251
|
|
|
|
|
|
|
} |
2252
|
|
|
|
|
|
|
|
2253
|
|
|
|
|
|
|
# Accessors for builder |
2254
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 134 |
2255
|
|
|
|
|
|
|
if ($__XS) { |
2256
|
|
|
|
|
|
|
Class::XSAccessor->import( |
2257
|
|
|
|
|
|
|
chained => 1, |
2258
|
|
|
|
|
|
|
"exists_predicates" => { "has_builder" => "builder" }, |
2259
|
|
|
|
|
|
|
); |
2260
|
|
|
|
|
|
|
} |
2261
|
|
|
|
|
|
|
else { |
2262
|
|
|
|
|
|
|
*has_builder = sub { |
2263
|
|
|
|
|
|
|
@_ == 1 |
2264
|
|
|
|
|
|
|
or croak('Predicate "has_builder" usage: $self->has_builder()'); |
2265
|
|
|
|
|
|
|
exists $_[0]{"builder"}; |
2266
|
|
|
|
|
|
|
}; |
2267
|
|
|
|
|
|
|
} |
2268
|
|
|
|
|
|
|
|
2269
|
|
|
|
|
|
|
sub builder { |
2270
|
|
|
|
|
|
|
@_ > 1 |
2271
|
|
|
|
|
|
|
? do { |
2272
|
17
|
50
|
|
|
|
34
|
do { |
2273
|
|
|
|
|
|
|
|
2274
|
|
|
|
|
|
|
package Mite::Shim; |
2275
|
|
|
|
|
|
|
( |
2276
|
|
|
|
|
|
|
do { |
2277
|
|
|
|
|
|
|
|
2278
|
|
|
|
|
|
|
package Mite::Shim; |
2279
|
|
|
|
|
|
|
( |
2280
|
|
|
|
|
|
|
( |
2281
|
|
|
|
|
|
|
( |
2282
|
|
|
|
|
|
|
do { |
2283
|
|
|
|
|
|
|
|
2284
|
|
|
|
|
|
|
package Mite::Shim; |
2285
|
17
|
50
|
|
|
|
120
|
defined( $_[1] ) and do { |
2286
|
17
|
50
|
|
|
|
173
|
ref( \$_[1] ) eq 'SCALAR' |
2287
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
2288
|
|
|
|
|
|
|
'SCALAR'; |
2289
|
|
|
|
|
|
|
} |
2290
|
|
|
|
|
|
|
} |
2291
|
|
|
|
|
|
|
) |
2292
|
|
|
|
|
|
|
&& ( |
2293
|
17
|
|
|
|
|
44
|
do { local $_ = $_[1]; /\A[^\W0-9]\w*\z/ } |
|
17
|
|
|
|
|
214
|
|
2294
|
|
|
|
|
|
|
) |
2295
|
|
|
|
|
|
|
) |
2296
|
|
|
|
|
|
|
or ( |
2297
|
|
|
|
|
|
|
( |
2298
|
|
|
|
|
|
|
do { |
2299
|
|
|
|
|
|
|
|
2300
|
|
|
|
|
|
|
package Mite::Shim; |
2301
|
8
|
50
|
|
|
|
73
|
defined( $_[1] ) and do { |
2302
|
8
|
50
|
|
|
|
76
|
ref( \$_[1] ) eq 'SCALAR' |
2303
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
2304
|
|
|
|
|
|
|
'SCALAR'; |
2305
|
|
|
|
|
|
|
} |
2306
|
|
|
|
|
|
|
} |
2307
|
|
|
|
|
|
|
) |
2308
|
|
|
|
|
|
|
&& ( |
2309
|
17
|
100
|
33
|
|
|
40
|
do { local $_ = $_[1]; /\%/ } |
|
8
|
|
66
|
|
|
37
|
|
|
8
|
|
|
|
|
92
|
|
2310
|
|
|
|
|
|
|
) |
2311
|
|
|
|
|
|
|
) |
2312
|
|
|
|
|
|
|
); |
2313
|
|
|
|
|
|
|
} |
2314
|
17
|
50
|
66
|
|
|
38
|
or do { |
2315
|
|
|
|
|
|
|
|
2316
|
|
|
|
|
|
|
package Mite::Shim; |
2317
|
8
|
50
|
33
|
|
|
179
|
( defined( $_[1] ) |
2318
|
|
|
|
|
|
|
and !ref( $_[1] ) |
2319
|
|
|
|
|
|
|
and $_[1] =~ m{\A(?:1)\z} ); |
2320
|
|
|
|
|
|
|
} |
2321
|
|
|
|
|
|
|
or ( ref( $_[1] ) eq 'CODE' ) |
2322
|
|
|
|
|
|
|
); |
2323
|
|
|
|
|
|
|
} |
2324
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2325
|
|
|
|
|
|
|
"accessor", "MethodNameTemplate|One|CodeRef" ); |
2326
|
17
|
|
|
|
|
54
|
$_[0]{"builder"} = $_[1]; |
2327
|
17
|
|
|
|
|
54
|
$_[0]; |
2328
|
|
|
|
|
|
|
} |
2329
|
377
|
100
|
|
377
|
0
|
2855
|
: ( $_[0]{"builder"} ); |
2330
|
|
|
|
|
|
|
} |
2331
|
|
|
|
|
|
|
|
2332
|
|
|
|
|
|
|
# Accessors for class |
2333
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 25 |
2334
|
|
|
|
|
|
|
sub class { |
2335
|
|
|
|
|
|
|
@_ > 1 |
2336
|
|
|
|
|
|
|
? do { |
2337
|
0
|
0
|
0
|
|
|
0
|
blessed( $_[1] ) && $_[1]->isa("Mite::Package") |
2338
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2339
|
|
|
|
|
|
|
"accessor", "Mite::Package" ); |
2340
|
0
|
|
|
|
|
0
|
$_[0]{"class"} = $_[1]; |
2341
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $_[0]{"class"} ) |
2342
|
0
|
0
|
0
|
|
|
0
|
if ref $_[0]{"class"}; |
2343
|
0
|
|
|
|
|
0
|
$_[0]; |
2344
|
|
|
|
|
|
|
} |
2345
|
173
|
50
|
|
173
|
0
|
1637
|
: ( $_[0]{"class"} ); |
2346
|
|
|
|
|
|
|
} |
2347
|
|
|
|
|
|
|
|
2348
|
|
|
|
|
|
|
# Accessors for clearer |
2349
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
2350
|
|
|
|
|
|
|
sub clearer { |
2351
|
|
|
|
|
|
|
@_ > 1 |
2352
|
|
|
|
|
|
|
? do { |
2353
|
3
|
50
|
|
|
|
10
|
do { |
2354
|
|
|
|
|
|
|
|
2355
|
|
|
|
|
|
|
package Mite::Shim; |
2356
|
|
|
|
|
|
|
( |
2357
|
|
|
|
|
|
|
do { |
2358
|
|
|
|
|
|
|
|
2359
|
|
|
|
|
|
|
package Mite::Shim; |
2360
|
|
|
|
|
|
|
( |
2361
|
|
|
|
|
|
|
( |
2362
|
|
|
|
|
|
|
( |
2363
|
|
|
|
|
|
|
do { |
2364
|
|
|
|
|
|
|
|
2365
|
|
|
|
|
|
|
package Mite::Shim; |
2366
|
3
|
50
|
|
|
|
34
|
defined( $_[1] ) and do { |
2367
|
3
|
50
|
|
|
|
49
|
ref( \$_[1] ) eq 'SCALAR' |
2368
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
2369
|
|
|
|
|
|
|
'SCALAR'; |
2370
|
|
|
|
|
|
|
} |
2371
|
|
|
|
|
|
|
} |
2372
|
|
|
|
|
|
|
) |
2373
|
|
|
|
|
|
|
&& ( |
2374
|
3
|
|
|
|
|
14
|
do { local $_ = $_[1]; /\A[^\W0-9]\w*\z/ } |
|
3
|
|
|
|
|
66
|
|
2375
|
|
|
|
|
|
|
) |
2376
|
|
|
|
|
|
|
) |
2377
|
|
|
|
|
|
|
or ( |
2378
|
|
|
|
|
|
|
( |
2379
|
|
|
|
|
|
|
do { |
2380
|
|
|
|
|
|
|
|
2381
|
|
|
|
|
|
|
package Mite::Shim; |
2382
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
2383
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
2384
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
2385
|
|
|
|
|
|
|
'SCALAR'; |
2386
|
|
|
|
|
|
|
} |
2387
|
|
|
|
|
|
|
} |
2388
|
|
|
|
|
|
|
) |
2389
|
|
|
|
|
|
|
&& ( |
2390
|
3
|
50
|
0
|
|
|
8
|
do { local $_ = $_[1]; /\%/ } |
|
0
|
|
33
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
2391
|
|
|
|
|
|
|
) |
2392
|
|
|
|
|
|
|
) |
2393
|
|
|
|
|
|
|
); |
2394
|
|
|
|
|
|
|
} |
2395
|
3
|
0
|
33
|
|
|
19
|
or do { |
2396
|
|
|
|
|
|
|
|
2397
|
|
|
|
|
|
|
package Mite::Shim; |
2398
|
0
|
0
|
0
|
|
|
0
|
( defined( $_[1] ) |
2399
|
|
|
|
|
|
|
and !ref( $_[1] ) |
2400
|
|
|
|
|
|
|
and $_[1] =~ m{\A(?:1)\z} ); |
2401
|
|
|
|
|
|
|
} |
2402
|
|
|
|
|
|
|
or ( !defined( $_[1] ) ) |
2403
|
|
|
|
|
|
|
); |
2404
|
|
|
|
|
|
|
} |
2405
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2406
|
|
|
|
|
|
|
"accessor", "MethodNameTemplate|One|Undef" ); |
2407
|
3
|
|
|
|
|
16
|
$_[0]{"clearer"} = $_[1]; |
2408
|
3
|
|
|
|
|
12
|
$_[0]; |
2409
|
|
|
|
|
|
|
} |
2410
|
298
|
100
|
|
298
|
0
|
2903
|
: do { |
2411
|
|
|
|
|
|
|
( |
2412
|
|
|
|
|
|
|
exists( $_[0]{"clearer"} ) ? $_[0]{"clearer"} : ( |
2413
|
295
|
100
|
|
|
|
996
|
$_[0]{"clearer"} = do { |
2414
|
163
|
|
|
|
|
688
|
my $default_value = $_[0]->_build_clearer; |
2415
|
163
|
50
|
|
|
|
357
|
do { |
2416
|
|
|
|
|
|
|
|
2417
|
|
|
|
|
|
|
package Mite::Shim; |
2418
|
|
|
|
|
|
|
( |
2419
|
|
|
|
|
|
|
do { |
2420
|
|
|
|
|
|
|
|
2421
|
|
|
|
|
|
|
package Mite::Shim; |
2422
|
|
|
|
|
|
|
( |
2423
|
|
|
|
|
|
|
( |
2424
|
|
|
|
|
|
|
( |
2425
|
|
|
|
|
|
|
do { |
2426
|
|
|
|
|
|
|
|
2427
|
|
|
|
|
|
|
package Mite::Shim; |
2428
|
|
|
|
|
|
|
defined($default_value) |
2429
|
163
|
50
|
|
|
|
1437
|
and do { |
2430
|
0
|
0
|
|
|
|
0
|
ref( \$default_value ) |
2431
|
|
|
|
|
|
|
eq 'SCALAR' |
2432
|
|
|
|
|
|
|
or ref( |
2433
|
|
|
|
|
|
|
\( |
2434
|
|
|
|
|
|
|
my $val = |
2435
|
|
|
|
|
|
|
$default_value |
2436
|
|
|
|
|
|
|
) |
2437
|
|
|
|
|
|
|
) eq 'SCALAR'; |
2438
|
|
|
|
|
|
|
} |
2439
|
|
|
|
|
|
|
} |
2440
|
|
|
|
|
|
|
) |
2441
|
|
|
|
|
|
|
&& ( |
2442
|
|
|
|
|
|
|
do { |
2443
|
0
|
|
|
|
|
0
|
local $_ = $default_value; |
2444
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*\z/; |
2445
|
|
|
|
|
|
|
} |
2446
|
|
|
|
|
|
|
) |
2447
|
|
|
|
|
|
|
) |
2448
|
|
|
|
|
|
|
or ( |
2449
|
|
|
|
|
|
|
( |
2450
|
|
|
|
|
|
|
do { |
2451
|
|
|
|
|
|
|
|
2452
|
|
|
|
|
|
|
package Mite::Shim; |
2453
|
|
|
|
|
|
|
defined($default_value) |
2454
|
163
|
50
|
|
|
|
1450
|
and do { |
2455
|
0
|
0
|
|
|
|
0
|
ref( \$default_value ) |
2456
|
|
|
|
|
|
|
eq 'SCALAR' |
2457
|
|
|
|
|
|
|
or ref( |
2458
|
|
|
|
|
|
|
\( |
2459
|
|
|
|
|
|
|
my $val = |
2460
|
|
|
|
|
|
|
$default_value |
2461
|
|
|
|
|
|
|
) |
2462
|
|
|
|
|
|
|
) eq 'SCALAR'; |
2463
|
|
|
|
|
|
|
} |
2464
|
|
|
|
|
|
|
} |
2465
|
|
|
|
|
|
|
) |
2466
|
|
|
|
|
|
|
&& ( |
2467
|
163
|
50
|
33
|
|
|
292
|
do { |
|
|
|
33
|
|
|
|
|
2468
|
0
|
|
|
|
|
0
|
local $_ = $default_value; |
2469
|
0
|
|
|
|
|
0
|
/\%/; |
2470
|
|
|
|
|
|
|
} |
2471
|
|
|
|
|
|
|
) |
2472
|
|
|
|
|
|
|
) |
2473
|
|
|
|
|
|
|
); |
2474
|
|
|
|
|
|
|
} |
2475
|
163
|
50
|
33
|
|
|
359
|
or do { |
2476
|
|
|
|
|
|
|
|
2477
|
|
|
|
|
|
|
package Mite::Shim; |
2478
|
163
|
50
|
33
|
|
|
1451
|
( defined($default_value) |
2479
|
|
|
|
|
|
|
and !ref($default_value) |
2480
|
|
|
|
|
|
|
and $default_value =~ m{\A(?:1)\z} ); |
2481
|
|
|
|
|
|
|
} |
2482
|
|
|
|
|
|
|
or ( !defined($default_value) ) |
2483
|
|
|
|
|
|
|
); |
2484
|
|
|
|
|
|
|
} |
2485
|
|
|
|
|
|
|
or croak( |
2486
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
2487
|
|
|
|
|
|
|
"clearer", |
2488
|
|
|
|
|
|
|
"MethodNameTemplate|One|Undef" |
2489
|
|
|
|
|
|
|
); |
2490
|
163
|
|
|
|
|
726
|
$default_value; |
2491
|
|
|
|
|
|
|
} |
2492
|
|
|
|
|
|
|
) |
2493
|
|
|
|
|
|
|
) |
2494
|
|
|
|
|
|
|
} |
2495
|
|
|
|
|
|
|
} |
2496
|
|
|
|
|
|
|
|
2497
|
|
|
|
|
|
|
# Accessors for clone |
2498
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 139 |
2499
|
|
|
|
|
|
|
if ($__XS) { |
2500
|
|
|
|
|
|
|
Class::XSAccessor->import( |
2501
|
|
|
|
|
|
|
chained => 1, |
2502
|
|
|
|
|
|
|
"getters" => { "cloner_method" => "clone" }, |
2503
|
|
|
|
|
|
|
); |
2504
|
|
|
|
|
|
|
} |
2505
|
|
|
|
|
|
|
else { |
2506
|
|
|
|
|
|
|
*cloner_method = sub { |
2507
|
|
|
|
|
|
|
@_ == 1 |
2508
|
|
|
|
|
|
|
or croak('Reader "cloner_method" usage: $self->cloner_method()'); |
2509
|
|
|
|
|
|
|
$_[0]{"clone"}; |
2510
|
|
|
|
|
|
|
}; |
2511
|
|
|
|
|
|
|
} |
2512
|
|
|
|
|
|
|
|
2513
|
|
|
|
|
|
|
# Accessors for clone_on_read |
2514
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 148 |
2515
|
|
|
|
|
|
|
sub clone_on_read { |
2516
|
226
|
50
|
|
226
|
0
|
792
|
@_ == 1 |
2517
|
|
|
|
|
|
|
or croak('Reader "clone_on_read" usage: $self->clone_on_read()'); |
2518
|
|
|
|
|
|
|
( |
2519
|
|
|
|
|
|
|
exists( $_[0]{"clone_on_read"} ) ? $_[0]{"clone_on_read"} : ( |
2520
|
226
|
100
|
|
|
|
1004
|
$_[0]{"clone_on_read"} = do { |
2521
|
115
|
|
|
|
|
249
|
my $default_value = do { |
2522
|
115
|
|
|
|
|
507
|
my $to_coerce = $_[0]->_build_clone_on_read; |
2523
|
|
|
|
|
|
|
( |
2524
|
|
|
|
|
|
|
( |
2525
|
|
|
|
|
|
|
!ref $to_coerce |
2526
|
|
|
|
|
|
|
and (!defined $to_coerce |
2527
|
|
|
|
|
|
|
or $to_coerce eq q() |
2528
|
|
|
|
|
|
|
or $to_coerce eq '0' |
2529
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
2530
|
|
|
|
|
|
|
) |
2531
|
|
|
|
|
|
|
) ? $to_coerce |
2532
|
|
|
|
|
|
|
: ( ( !!1 ) ) |
2533
|
115
|
50
|
33
|
|
|
1757
|
? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
2534
|
|
|
|
|
|
|
: $to_coerce; |
2535
|
|
|
|
|
|
|
}; |
2536
|
|
|
|
|
|
|
( |
2537
|
115
|
50
|
66
|
|
|
1441
|
!ref $default_value |
|
|
|
66
|
|
|
|
|
2538
|
|
|
|
|
|
|
and (!defined $default_value |
2539
|
|
|
|
|
|
|
or $default_value eq q() |
2540
|
|
|
|
|
|
|
or $default_value eq '0' |
2541
|
|
|
|
|
|
|
or $default_value eq '1' ) |
2542
|
|
|
|
|
|
|
) |
2543
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
2544
|
|
|
|
|
|
|
"clone_on_read", "Bool" ); |
2545
|
115
|
|
|
|
|
774
|
$default_value; |
2546
|
|
|
|
|
|
|
} |
2547
|
|
|
|
|
|
|
) |
2548
|
|
|
|
|
|
|
); |
2549
|
|
|
|
|
|
|
} |
2550
|
|
|
|
|
|
|
|
2551
|
|
|
|
|
|
|
# Accessors for clone_on_write |
2552
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 148 |
2553
|
|
|
|
|
|
|
sub clone_on_write { |
2554
|
293
|
50
|
|
293
|
0
|
1011
|
@_ == 1 |
2555
|
|
|
|
|
|
|
or croak('Reader "clone_on_write" usage: $self->clone_on_write()'); |
2556
|
|
|
|
|
|
|
( |
2557
|
|
|
|
|
|
|
exists( $_[0]{"clone_on_write"} ) ? $_[0]{"clone_on_write"} : ( |
2558
|
293
|
100
|
|
|
|
1374
|
$_[0]{"clone_on_write"} = do { |
2559
|
115
|
|
|
|
|
254
|
my $default_value = do { |
2560
|
115
|
|
|
|
|
591
|
my $to_coerce = $_[0]->_build_clone_on_write; |
2561
|
|
|
|
|
|
|
( |
2562
|
|
|
|
|
|
|
( |
2563
|
|
|
|
|
|
|
!ref $to_coerce |
2564
|
|
|
|
|
|
|
and (!defined $to_coerce |
2565
|
|
|
|
|
|
|
or $to_coerce eq q() |
2566
|
|
|
|
|
|
|
or $to_coerce eq '0' |
2567
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
2568
|
|
|
|
|
|
|
) |
2569
|
|
|
|
|
|
|
) ? $to_coerce |
2570
|
|
|
|
|
|
|
: ( ( !!1 ) ) |
2571
|
115
|
50
|
33
|
|
|
2165
|
? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
2572
|
|
|
|
|
|
|
: $to_coerce; |
2573
|
|
|
|
|
|
|
}; |
2574
|
|
|
|
|
|
|
( |
2575
|
115
|
50
|
66
|
|
|
1522
|
!ref $default_value |
|
|
|
66
|
|
|
|
|
2576
|
|
|
|
|
|
|
and (!defined $default_value |
2577
|
|
|
|
|
|
|
or $default_value eq q() |
2578
|
|
|
|
|
|
|
or $default_value eq '0' |
2579
|
|
|
|
|
|
|
or $default_value eq '1' ) |
2580
|
|
|
|
|
|
|
) |
2581
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
2582
|
|
|
|
|
|
|
"clone_on_write", "Bool" ); |
2583
|
115
|
|
|
|
|
854
|
$default_value; |
2584
|
|
|
|
|
|
|
} |
2585
|
|
|
|
|
|
|
) |
2586
|
|
|
|
|
|
|
); |
2587
|
|
|
|
|
|
|
} |
2588
|
|
|
|
|
|
|
|
2589
|
|
|
|
|
|
|
# Accessors for coderef_default_variable |
2590
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 132 |
2591
|
|
|
|
|
|
|
sub coderef_default_variable { |
2592
|
|
|
|
|
|
|
@_ > 1 |
2593
|
|
|
|
|
|
|
? do { |
2594
|
|
|
|
|
|
|
( |
2595
|
|
|
|
|
|
|
( |
2596
|
0
|
0
|
0
|
|
|
0
|
do { |
2597
|
|
|
|
|
|
|
|
2598
|
|
|
|
|
|
|
package Mite::Shim; |
2599
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
2600
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
2601
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq 'SCALAR'; |
2602
|
|
|
|
|
|
|
} |
2603
|
|
|
|
|
|
|
} |
2604
|
|
|
|
|
|
|
) |
2605
|
|
|
|
|
|
|
&& ( length( $_[1] ) > 0 ) |
2606
|
|
|
|
|
|
|
) |
2607
|
|
|
|
|
|
|
or croak( |
2608
|
|
|
|
|
|
|
"Type check failed in %s: value should be %s", |
2609
|
|
|
|
|
|
|
"accessor", |
2610
|
|
|
|
|
|
|
"NonEmptyStr" |
2611
|
|
|
|
|
|
|
); |
2612
|
0
|
|
|
|
|
0
|
$_[0]{"coderef_default_variable"} = $_[1]; |
2613
|
0
|
|
|
|
|
0
|
$_[0]; |
2614
|
|
|
|
|
|
|
} |
2615
|
31
|
50
|
|
31
|
0
|
3279
|
: do { |
2616
|
|
|
|
|
|
|
( |
2617
|
|
|
|
|
|
|
exists( $_[0]{"coderef_default_variable"} ) |
2618
|
|
|
|
|
|
|
? $_[0]{"coderef_default_variable"} |
2619
|
|
|
|
|
|
|
: ( |
2620
|
31
|
100
|
|
|
|
108
|
$_[0]{"coderef_default_variable"} = do { |
2621
|
27
|
|
|
|
|
178
|
my $default_value = |
2622
|
|
|
|
|
|
|
$Mite::Attribute::__coderef_default_variable_DEFAULT__ |
2623
|
|
|
|
|
|
|
->( $_[0] ); |
2624
|
|
|
|
|
|
|
( |
2625
|
|
|
|
|
|
|
( |
2626
|
27
|
50
|
33
|
|
|
79
|
do { |
2627
|
|
|
|
|
|
|
|
2628
|
|
|
|
|
|
|
package Mite::Shim; |
2629
|
27
|
50
|
|
|
|
270
|
defined($default_value) and do { |
2630
|
27
|
50
|
|
|
|
320
|
ref( \$default_value ) eq 'SCALAR' |
2631
|
|
|
|
|
|
|
or |
2632
|
|
|
|
|
|
|
ref( \( my $val = $default_value ) ) |
2633
|
|
|
|
|
|
|
eq 'SCALAR'; |
2634
|
|
|
|
|
|
|
} |
2635
|
|
|
|
|
|
|
} |
2636
|
|
|
|
|
|
|
) |
2637
|
|
|
|
|
|
|
&& ( length($default_value) > 0 ) |
2638
|
|
|
|
|
|
|
) |
2639
|
|
|
|
|
|
|
or croak( |
2640
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
2641
|
|
|
|
|
|
|
"coderef_default_variable", |
2642
|
|
|
|
|
|
|
"NonEmptyStr" |
2643
|
|
|
|
|
|
|
); |
2644
|
27
|
|
|
|
|
176
|
$default_value; |
2645
|
|
|
|
|
|
|
} |
2646
|
|
|
|
|
|
|
) |
2647
|
|
|
|
|
|
|
) |
2648
|
|
|
|
|
|
|
} |
2649
|
|
|
|
|
|
|
} |
2650
|
|
|
|
|
|
|
|
2651
|
|
|
|
|
|
|
# Accessors for coerce |
2652
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 97 |
2653
|
|
|
|
|
|
|
sub coerce { |
2654
|
|
|
|
|
|
|
@_ > 1 |
2655
|
|
|
|
|
|
|
? do { |
2656
|
|
|
|
|
|
|
( |
2657
|
0
|
0
|
0
|
|
|
0
|
!ref $_[1] |
|
|
|
0
|
|
|
|
|
2658
|
|
|
|
|
|
|
and (!defined $_[1] |
2659
|
|
|
|
|
|
|
or $_[1] eq q() |
2660
|
|
|
|
|
|
|
or $_[1] eq '0' |
2661
|
|
|
|
|
|
|
or $_[1] eq '1' ) |
2662
|
|
|
|
|
|
|
) |
2663
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2664
|
|
|
|
|
|
|
"accessor", "Bool" ); |
2665
|
0
|
|
|
|
|
0
|
$_[0]{"coerce"} = $_[1]; |
2666
|
0
|
|
|
|
|
0
|
$_[0]; |
2667
|
|
|
|
|
|
|
} |
2668
|
82
|
50
|
|
82
|
0
|
556
|
: ( $_[0]{"coerce"} ); |
2669
|
|
|
|
|
|
|
} |
2670
|
|
|
|
|
|
|
|
2671
|
|
|
|
|
|
|
# Accessors for compiling_class |
2672
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 30 |
2673
|
|
|
|
|
|
|
sub compiling_class { |
2674
|
|
|
|
|
|
|
@_ > 1 |
2675
|
|
|
|
|
|
|
? do { |
2676
|
243
|
50
|
33
|
|
|
2413
|
blessed( $_[1] ) && $_[1]->isa("Mite::Package") |
2677
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2678
|
|
|
|
|
|
|
"accessor", "Mite::Package" ); |
2679
|
243
|
|
|
|
|
922
|
$_[0]{"compiling_class"} = $_[1]; |
2680
|
243
|
|
|
|
|
541
|
$_[0]; |
2681
|
|
|
|
|
|
|
} |
2682
|
719
|
100
|
|
719
|
0
|
3261
|
: ( $_[0]{"compiling_class"} ); |
2683
|
|
|
|
|
|
|
} |
2684
|
|
|
|
|
|
|
|
2685
|
|
|
|
|
|
|
sub locally_set_compiling_class { |
2686
|
|
|
|
|
|
|
defined wantarray |
2687
|
243
|
50
|
|
243
|
0
|
858
|
or croak("This method cannot be called in void context"); |
2688
|
243
|
|
|
|
|
661
|
my $get = "compiling_class"; |
2689
|
243
|
|
|
|
|
599
|
my $set = "compiling_class"; |
2690
|
243
|
|
|
243
|
|
1171
|
my $has = sub { exists $_[0]{"compiling_class"} }; |
|
243
|
|
|
|
|
1456
|
|
2691
|
243
|
|
|
243
|
|
1057
|
my $clear = sub { delete $_[0]{"compiling_class"}; $_[0]; }; |
|
243
|
|
|
|
|
644
|
|
|
243
|
|
|
|
|
1653
|
|
2692
|
243
|
|
|
|
|
507
|
my $old = undef; |
2693
|
243
|
|
|
|
|
604
|
my ( $self, $new ) = @_; |
2694
|
|
|
|
|
|
|
my $restorer = $self->$has |
2695
|
|
|
|
|
|
|
? do { |
2696
|
0
|
|
|
|
|
0
|
$old = $self->$get; |
2697
|
0
|
|
|
0
|
|
0
|
sub { $self->$set($old) } |
2698
|
0
|
|
|
|
|
0
|
} |
2699
|
243
|
50
|
|
243
|
|
664
|
: sub { $self->$clear }; |
|
243
|
|
|
|
|
766
|
|
2700
|
243
|
50
|
|
|
|
1496
|
@_ == 2 ? $self->$set($new) : $self->$clear; |
2701
|
243
|
|
|
|
|
1032
|
&guard( $restorer, $old ); |
2702
|
|
|
|
|
|
|
} |
2703
|
|
|
|
|
|
|
|
2704
|
|
|
|
|
|
|
# Accessors for default |
2705
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 107 |
2706
|
|
|
|
|
|
|
if ($__XS) { |
2707
|
|
|
|
|
|
|
Class::XSAccessor->import( |
2708
|
|
|
|
|
|
|
chained => 1, |
2709
|
|
|
|
|
|
|
"exists_predicates" => { "has_default" => "default" }, |
2710
|
|
|
|
|
|
|
); |
2711
|
|
|
|
|
|
|
} |
2712
|
|
|
|
|
|
|
else { |
2713
|
|
|
|
|
|
|
*has_default = sub { |
2714
|
|
|
|
|
|
|
@_ == 1 |
2715
|
|
|
|
|
|
|
or croak('Predicate "has_default" usage: $self->has_default()'); |
2716
|
|
|
|
|
|
|
exists $_[0]{"default"}; |
2717
|
|
|
|
|
|
|
}; |
2718
|
|
|
|
|
|
|
} |
2719
|
|
|
|
|
|
|
|
2720
|
|
|
|
|
|
|
sub default { |
2721
|
|
|
|
|
|
|
@_ > 1 |
2722
|
|
|
|
|
|
|
? do { |
2723
|
3
|
50
|
|
|
|
27
|
do { |
2724
|
|
|
|
|
|
|
|
2725
|
|
|
|
|
|
|
package Mite::Shim; |
2726
|
|
|
|
|
|
|
( |
2727
|
|
|
|
|
|
|
( !defined( $_[1] ) ) or do { |
2728
|
|
|
|
|
|
|
|
2729
|
|
|
|
|
|
|
package Mite::Shim; |
2730
|
3
|
50
|
|
|
|
45
|
defined( $_[1] ) and do { |
2731
|
3
|
50
|
|
|
|
54
|
ref( \$_[1] ) eq 'SCALAR' |
2732
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq 'SCALAR'; |
2733
|
|
|
|
|
|
|
} |
2734
|
|
|
|
|
|
|
} |
2735
|
|
|
|
|
|
|
or ( ref( $_[1] ) eq 'CODE' ) |
2736
|
|
|
|
|
|
|
or ( ref( $_[1] ) eq 'SCALAR' or ref( $_[1] ) eq 'REF' ) |
2737
|
|
|
|
|
|
|
or do { |
2738
|
|
|
|
|
|
|
|
2739
|
|
|
|
|
|
|
package Mite::Shim; |
2740
|
|
|
|
|
|
|
( ref( $_[1] ) eq 'HASH' ) |
2741
|
0
|
0
|
|
|
|
0
|
and not( grep !/\A(?:)\z/, keys %{ $_[1] } ); |
|
0
|
|
|
|
|
0
|
|
2742
|
|
|
|
|
|
|
} |
2743
|
3
|
0
|
33
|
|
|
63
|
or do { |
|
|
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2744
|
|
|
|
|
|
|
|
2745
|
|
|
|
|
|
|
package Mite::Shim; |
2746
|
0
|
0
|
|
|
|
0
|
( ref( $_[1] ) eq 'ARRAY' ) and @{ $_[1] } == 0; |
|
0
|
|
|
|
|
0
|
|
2747
|
|
|
|
|
|
|
} |
2748
|
|
|
|
|
|
|
); |
2749
|
|
|
|
|
|
|
} |
2750
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2751
|
|
|
|
|
|
|
"accessor", "Undef|Str|CodeRef|ScalarRef|Dict[]|Tuple[]" ); |
2752
|
3
|
|
|
|
|
15
|
$_[0]{"default"} = $_[1]; |
2753
|
3
|
|
|
|
|
12
|
$_[0]; |
2754
|
|
|
|
|
|
|
} |
2755
|
378
|
100
|
|
378
|
0
|
9302
|
: ( $_[0]{"default"} ); |
2756
|
|
|
|
|
|
|
} |
2757
|
|
|
|
|
|
|
|
2758
|
|
|
|
|
|
|
# Accessors for default_does_trigger |
2759
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 113 |
2760
|
|
|
|
|
|
|
sub default_does_trigger { |
2761
|
|
|
|
|
|
|
@_ > 1 |
2762
|
|
|
|
|
|
|
? do { |
2763
|
0
|
|
|
|
|
0
|
my $value = do { |
2764
|
0
|
|
|
|
|
0
|
my $to_coerce = $_[1]; |
2765
|
|
|
|
|
|
|
( |
2766
|
|
|
|
|
|
|
( |
2767
|
|
|
|
|
|
|
!ref $to_coerce |
2768
|
|
|
|
|
|
|
and (!defined $to_coerce |
2769
|
|
|
|
|
|
|
or $to_coerce eq q() |
2770
|
|
|
|
|
|
|
or $to_coerce eq '0' |
2771
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
2772
|
|
|
|
|
|
|
) |
2773
|
|
|
|
|
|
|
) ? $to_coerce |
2774
|
0
|
0
|
0
|
|
|
0
|
: ( ( !!1 ) ) ? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
2775
|
|
|
|
|
|
|
: $to_coerce; |
2776
|
|
|
|
|
|
|
}; |
2777
|
|
|
|
|
|
|
( |
2778
|
0
|
0
|
0
|
|
|
0
|
!ref $value |
|
|
|
0
|
|
|
|
|
2779
|
|
|
|
|
|
|
and (!defined $value |
2780
|
|
|
|
|
|
|
or $value eq q() |
2781
|
|
|
|
|
|
|
or $value eq '0' |
2782
|
|
|
|
|
|
|
or $value eq '1' ) |
2783
|
|
|
|
|
|
|
) |
2784
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2785
|
|
|
|
|
|
|
"accessor", "Bool" ); |
2786
|
0
|
|
|
|
|
0
|
$_[0]{"default_does_trigger"} = $value; |
2787
|
0
|
|
|
|
|
0
|
$_[0]; |
2788
|
|
|
|
|
|
|
} |
2789
|
81
|
50
|
|
81
|
0
|
720
|
: ( $_[0]{"default_does_trigger"} ); |
2790
|
|
|
|
|
|
|
} |
2791
|
|
|
|
|
|
|
|
2792
|
|
|
|
|
|
|
# Accessors for default_is_trusted |
2793
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 113 |
2794
|
|
|
|
|
|
|
sub default_is_trusted { |
2795
|
|
|
|
|
|
|
@_ > 1 |
2796
|
|
|
|
|
|
|
? do { |
2797
|
0
|
|
|
|
|
0
|
my $value = do { |
2798
|
0
|
|
|
|
|
0
|
my $to_coerce = $_[1]; |
2799
|
|
|
|
|
|
|
( |
2800
|
|
|
|
|
|
|
( |
2801
|
|
|
|
|
|
|
!ref $to_coerce |
2802
|
|
|
|
|
|
|
and (!defined $to_coerce |
2803
|
|
|
|
|
|
|
or $to_coerce eq q() |
2804
|
|
|
|
|
|
|
or $to_coerce eq '0' |
2805
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
2806
|
|
|
|
|
|
|
) |
2807
|
|
|
|
|
|
|
) ? $to_coerce |
2808
|
0
|
0
|
0
|
|
|
0
|
: ( ( !!1 ) ) ? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
2809
|
|
|
|
|
|
|
: $to_coerce; |
2810
|
|
|
|
|
|
|
}; |
2811
|
|
|
|
|
|
|
( |
2812
|
0
|
0
|
0
|
|
|
0
|
!ref $value |
|
|
|
0
|
|
|
|
|
2813
|
|
|
|
|
|
|
and (!defined $value |
2814
|
|
|
|
|
|
|
or $value eq q() |
2815
|
|
|
|
|
|
|
or $value eq '0' |
2816
|
|
|
|
|
|
|
or $value eq '1' ) |
2817
|
|
|
|
|
|
|
) |
2818
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2819
|
|
|
|
|
|
|
"accessor", "Bool" ); |
2820
|
0
|
|
|
|
|
0
|
$_[0]{"default_is_trusted"} = $value; |
2821
|
0
|
|
|
|
|
0
|
$_[0]; |
2822
|
|
|
|
|
|
|
} |
2823
|
81
|
50
|
|
81
|
0
|
829
|
: ( $_[0]{"default_is_trusted"} ); |
2824
|
|
|
|
|
|
|
} |
2825
|
|
|
|
|
|
|
|
2826
|
|
|
|
|
|
|
# Accessors for definition_context |
2827
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 20 |
2828
|
|
|
|
|
|
|
sub definition_context { |
2829
|
|
|
|
|
|
|
@_ > 1 |
2830
|
|
|
|
|
|
|
? do { |
2831
|
0
|
0
|
|
|
|
0
|
( ref( $_[1] ) eq 'HASH' ) |
2832
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2833
|
|
|
|
|
|
|
"accessor", "HashRef" ); |
2834
|
0
|
|
|
|
|
0
|
$_[0]{"definition_context"} = $_[1]; |
2835
|
0
|
|
|
|
|
0
|
$_[0]; |
2836
|
|
|
|
|
|
|
} |
2837
|
249
|
50
|
|
249
|
0
|
4302
|
: ( $_[0]{"definition_context"} ); |
2838
|
|
|
|
|
|
|
} |
2839
|
|
|
|
|
|
|
|
2840
|
|
|
|
|
|
|
# Accessors for documentation |
2841
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 150 |
2842
|
|
|
|
|
|
|
if ($__XS) { |
2843
|
|
|
|
|
|
|
Class::XSAccessor->import( |
2844
|
|
|
|
|
|
|
chained => 1, |
2845
|
|
|
|
|
|
|
"accessors" => { "documentation" => "documentation" }, |
2846
|
|
|
|
|
|
|
"exists_predicates" => { "has_documentation" => "documentation" }, |
2847
|
|
|
|
|
|
|
); |
2848
|
|
|
|
|
|
|
} |
2849
|
|
|
|
|
|
|
else { |
2850
|
|
|
|
|
|
|
*documentation = sub { |
2851
|
|
|
|
|
|
|
@_ > 1 |
2852
|
|
|
|
|
|
|
? do { $_[0]{"documentation"} = $_[1]; $_[0]; } |
2853
|
|
|
|
|
|
|
: ( $_[0]{"documentation"} ); |
2854
|
|
|
|
|
|
|
}; |
2855
|
|
|
|
|
|
|
*has_documentation = sub { |
2856
|
|
|
|
|
|
|
@_ == 1 |
2857
|
|
|
|
|
|
|
or croak( |
2858
|
|
|
|
|
|
|
'Predicate "has_documentation" usage: $self->has_documentation()' |
2859
|
|
|
|
|
|
|
); |
2860
|
|
|
|
|
|
|
exists $_[0]{"documentation"}; |
2861
|
|
|
|
|
|
|
}; |
2862
|
|
|
|
|
|
|
} |
2863
|
|
|
|
|
|
|
|
2864
|
|
|
|
|
|
|
# Accessors for does |
2865
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 82 |
2866
|
|
|
|
|
|
|
if ($__XS) { |
2867
|
|
|
|
|
|
|
Class::XSAccessor->import( |
2868
|
|
|
|
|
|
|
chained => 1, |
2869
|
|
|
|
|
|
|
"getters" => { "_does" => "does" }, |
2870
|
|
|
|
|
|
|
); |
2871
|
|
|
|
|
|
|
} |
2872
|
|
|
|
|
|
|
else { |
2873
|
|
|
|
|
|
|
*_does = sub { |
2874
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "_does" usage: $self->_does()'); |
2875
|
|
|
|
|
|
|
$_[0]{"does"}; |
2876
|
|
|
|
|
|
|
}; |
2877
|
|
|
|
|
|
|
} |
2878
|
|
|
|
|
|
|
|
2879
|
|
|
|
|
|
|
# Accessors for enum |
2880
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 87 |
2881
|
|
|
|
|
|
|
if ($__XS) { |
2882
|
|
|
|
|
|
|
Class::XSAccessor->import( |
2883
|
|
|
|
|
|
|
chained => 1, |
2884
|
|
|
|
|
|
|
"exists_predicates" => { "has_enum" => "enum" }, |
2885
|
|
|
|
|
|
|
); |
2886
|
|
|
|
|
|
|
} |
2887
|
|
|
|
|
|
|
else { |
2888
|
|
|
|
|
|
|
*has_enum = sub { |
2889
|
|
|
|
|
|
|
@_ == 1 or croak('Predicate "has_enum" usage: $self->has_enum()'); |
2890
|
|
|
|
|
|
|
exists $_[0]{"enum"}; |
2891
|
|
|
|
|
|
|
}; |
2892
|
|
|
|
|
|
|
} |
2893
|
|
|
|
|
|
|
|
2894
|
|
|
|
|
|
|
sub enum { |
2895
|
|
|
|
|
|
|
@_ > 1 |
2896
|
|
|
|
|
|
|
? do { |
2897
|
0
|
0
|
|
|
|
0
|
do { |
2898
|
|
|
|
|
|
|
|
2899
|
|
|
|
|
|
|
package Mite::Shim; |
2900
|
0
|
0
|
|
|
|
0
|
( ref( $_[1] ) eq 'ARRAY' ) and do { |
2901
|
0
|
|
|
|
|
0
|
my $ok = 1; |
2902
|
0
|
|
|
|
|
0
|
for my $i ( @{ $_[1] } ) { |
|
0
|
|
|
|
|
0
|
|
2903
|
|
|
|
|
|
|
( $ok = 0, last ) |
2904
|
|
|
|
|
|
|
unless ( |
2905
|
|
|
|
|
|
|
( |
2906
|
0
|
0
|
0
|
|
|
0
|
do { |
2907
|
|
|
|
|
|
|
|
2908
|
|
|
|
|
|
|
package Mite::Shim; |
2909
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
2910
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
2911
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
2912
|
|
|
|
|
|
|
'SCALAR'; |
2913
|
|
|
|
|
|
|
} |
2914
|
|
|
|
|
|
|
} |
2915
|
|
|
|
|
|
|
) |
2916
|
|
|
|
|
|
|
&& ( length($i) > 0 ) |
2917
|
|
|
|
|
|
|
); |
2918
|
|
|
|
|
|
|
}; |
2919
|
0
|
|
|
|
|
0
|
$ok; |
2920
|
|
|
|
|
|
|
} |
2921
|
|
|
|
|
|
|
} |
2922
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
2923
|
|
|
|
|
|
|
"accessor", "ArrayRef[NonEmptyStr]" ); |
2924
|
0
|
|
|
|
|
0
|
$_[0]{"enum"} = $_[1]; |
2925
|
0
|
|
|
|
|
0
|
$_[0]; |
2926
|
|
|
|
|
|
|
} |
2927
|
4
|
50
|
|
4
|
0
|
31
|
: ( $_[0]{"enum"} ); |
2928
|
|
|
|
|
|
|
} |
2929
|
|
|
|
|
|
|
|
2930
|
|
|
|
|
|
|
# Accessors for handles |
2931
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 154 |
2932
|
|
|
|
|
|
|
if ($__XS) { |
2933
|
|
|
|
|
|
|
Class::XSAccessor->import( |
2934
|
|
|
|
|
|
|
chained => 1, |
2935
|
|
|
|
|
|
|
"exists_predicates" => { "has_handles" => "handles" }, |
2936
|
|
|
|
|
|
|
); |
2937
|
|
|
|
|
|
|
} |
2938
|
|
|
|
|
|
|
else { |
2939
|
|
|
|
|
|
|
*has_handles = sub { |
2940
|
|
|
|
|
|
|
@_ == 1 |
2941
|
|
|
|
|
|
|
or croak('Predicate "has_handles" usage: $self->has_handles()'); |
2942
|
|
|
|
|
|
|
exists $_[0]{"handles"}; |
2943
|
|
|
|
|
|
|
}; |
2944
|
|
|
|
|
|
|
} |
2945
|
|
|
|
|
|
|
|
2946
|
|
|
|
|
|
|
sub handles { |
2947
|
|
|
|
|
|
|
@_ > 1 |
2948
|
|
|
|
|
|
|
? do { |
2949
|
0
|
|
|
|
|
0
|
my $value = do { |
2950
|
0
|
|
|
|
|
0
|
my $to_coerce = $_[1]; |
2951
|
|
|
|
|
|
|
( |
2952
|
|
|
|
|
|
|
do { |
2953
|
|
|
|
|
|
|
|
2954
|
|
|
|
|
|
|
package Mite::Shim; |
2955
|
|
|
|
|
|
|
( |
2956
|
|
|
|
|
|
|
do { |
2957
|
|
|
|
|
|
|
|
2958
|
|
|
|
|
|
|
package Mite::Shim; |
2959
|
0
|
0
|
|
|
|
0
|
( ref($to_coerce) eq 'HASH' ) and do { |
2960
|
0
|
|
|
|
|
0
|
my $ok = 1; |
2961
|
0
|
|
|
|
|
0
|
for my $v ( values %{$to_coerce} ) { |
|
0
|
|
|
|
|
0
|
|
2962
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
2963
|
|
|
|
|
|
|
|
2964
|
|
|
|
|
|
|
package Mite::Shim; |
2965
|
|
|
|
|
|
|
( |
2966
|
|
|
|
|
|
|
( |
2967
|
|
|
|
|
|
|
( |
2968
|
|
|
|
|
|
|
do { |
2969
|
|
|
|
|
|
|
|
2970
|
|
|
|
|
|
|
package Mite::Shim; |
2971
|
0
|
0
|
|
|
|
0
|
defined($v) and do { |
2972
|
0
|
0
|
|
|
|
0
|
ref( \$v ) eq |
2973
|
|
|
|
|
|
|
'SCALAR' |
2974
|
|
|
|
|
|
|
or ref( |
2975
|
|
|
|
|
|
|
\( |
2976
|
|
|
|
|
|
|
my $val |
2977
|
|
|
|
|
|
|
= $v |
2978
|
|
|
|
|
|
|
) |
2979
|
|
|
|
|
|
|
) eq 'SCALAR'; |
2980
|
|
|
|
|
|
|
} |
2981
|
|
|
|
|
|
|
} |
2982
|
|
|
|
|
|
|
) |
2983
|
|
|
|
|
|
|
&& ( |
2984
|
0
|
0
|
0
|
|
|
0
|
do { |
|
|
|
0
|
|
|
|
|
2985
|
0
|
|
|
|
|
0
|
local $_ = $v; |
2986
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*\z/; |
2987
|
|
|
|
|
|
|
} |
2988
|
|
|
|
|
|
|
) |
2989
|
|
|
|
|
|
|
) |
2990
|
|
|
|
|
|
|
or ( ref($v) eq 'ARRAY' ) |
2991
|
|
|
|
|
|
|
or ( ref($v) eq 'CODE' ) |
2992
|
|
|
|
|
|
|
); |
2993
|
|
|
|
|
|
|
} |
2994
|
|
|
|
|
|
|
}; |
2995
|
0
|
|
|
|
|
0
|
for my $k ( keys %{$to_coerce} ) { |
|
0
|
|
|
|
|
0
|
|
2996
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
2997
|
|
|
|
|
|
|
|
2998
|
|
|
|
|
|
|
package Mite::Shim; |
2999
|
|
|
|
|
|
|
( |
3000
|
|
|
|
|
|
|
( |
3001
|
|
|
|
|
|
|
( |
3002
|
|
|
|
|
|
|
do { |
3003
|
|
|
|
|
|
|
|
3004
|
|
|
|
|
|
|
package Mite::Shim; |
3005
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
3006
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq |
3007
|
|
|
|
|
|
|
'SCALAR' |
3008
|
|
|
|
|
|
|
or ref( |
3009
|
|
|
|
|
|
|
\( |
3010
|
|
|
|
|
|
|
my $val |
3011
|
|
|
|
|
|
|
= $k |
3012
|
|
|
|
|
|
|
) |
3013
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3014
|
|
|
|
|
|
|
} |
3015
|
|
|
|
|
|
|
} |
3016
|
|
|
|
|
|
|
) |
3017
|
|
|
|
|
|
|
&& ( |
3018
|
|
|
|
|
|
|
do { |
3019
|
0
|
|
|
|
|
0
|
local $_ = $k; |
3020
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*\z/; |
3021
|
|
|
|
|
|
|
} |
3022
|
|
|
|
|
|
|
) |
3023
|
|
|
|
|
|
|
) |
3024
|
|
|
|
|
|
|
or ( |
3025
|
|
|
|
|
|
|
( |
3026
|
|
|
|
|
|
|
do { |
3027
|
|
|
|
|
|
|
|
3028
|
|
|
|
|
|
|
package Mite::Shim; |
3029
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
3030
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq |
3031
|
|
|
|
|
|
|
'SCALAR' |
3032
|
|
|
|
|
|
|
or ref( |
3033
|
|
|
|
|
|
|
\( |
3034
|
|
|
|
|
|
|
my $val |
3035
|
|
|
|
|
|
|
= $k |
3036
|
|
|
|
|
|
|
) |
3037
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3038
|
|
|
|
|
|
|
} |
3039
|
|
|
|
|
|
|
} |
3040
|
|
|
|
|
|
|
) |
3041
|
|
|
|
|
|
|
&& ( |
3042
|
0
|
0
|
0
|
|
|
0
|
do { |
|
|
|
0
|
|
|
|
|
3043
|
0
|
|
|
|
|
0
|
local $_ = $k; |
3044
|
0
|
|
|
|
|
0
|
/\%/; |
3045
|
|
|
|
|
|
|
} |
3046
|
|
|
|
|
|
|
) |
3047
|
|
|
|
|
|
|
) |
3048
|
|
|
|
|
|
|
); |
3049
|
|
|
|
|
|
|
} |
3050
|
|
|
|
|
|
|
}; |
3051
|
0
|
|
|
|
|
0
|
$ok; |
3052
|
|
|
|
|
|
|
} |
3053
|
|
|
|
|
|
|
} |
3054
|
0
|
0
|
|
|
|
0
|
or do { |
3055
|
|
|
|
|
|
|
|
3056
|
|
|
|
|
|
|
package Mite::Shim; |
3057
|
0
|
0
|
0
|
|
|
0
|
( defined($to_coerce) |
3058
|
|
|
|
|
|
|
and !ref($to_coerce) |
3059
|
|
|
|
|
|
|
and $to_coerce =~ m{\A(?:[12])\z} ); |
3060
|
|
|
|
|
|
|
} |
3061
|
|
|
|
|
|
|
); |
3062
|
|
|
|
|
|
|
} |
3063
|
|
|
|
|
|
|
) ? $to_coerce : ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
3064
|
0
|
0
|
|
|
|
0
|
do { |
|
|
0
|
|
|
|
|
|
3065
|
0
|
|
|
|
|
0
|
local $_ = $to_coerce; |
3066
|
0
|
|
|
|
|
0
|
+{ map { $_ => $_ } @$_ }; |
|
0
|
|
|
|
|
0
|
|
3067
|
|
|
|
|
|
|
} |
3068
|
|
|
|
|
|
|
) |
3069
|
|
|
|
|
|
|
: $to_coerce; |
3070
|
|
|
|
|
|
|
}; |
3071
|
0
|
0
|
|
|
|
0
|
do { |
3072
|
|
|
|
|
|
|
|
3073
|
|
|
|
|
|
|
package Mite::Shim; |
3074
|
|
|
|
|
|
|
( |
3075
|
|
|
|
|
|
|
do { |
3076
|
|
|
|
|
|
|
|
3077
|
|
|
|
|
|
|
package Mite::Shim; |
3078
|
0
|
0
|
|
|
|
0
|
( ref($value) eq 'HASH' ) and do { |
3079
|
0
|
|
|
|
|
0
|
my $ok = 1; |
3080
|
0
|
|
|
|
|
0
|
for my $v ( values %{$value} ) { |
|
0
|
|
|
|
|
0
|
|
3081
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
3082
|
|
|
|
|
|
|
|
3083
|
|
|
|
|
|
|
package Mite::Shim; |
3084
|
|
|
|
|
|
|
( |
3085
|
|
|
|
|
|
|
( |
3086
|
|
|
|
|
|
|
( |
3087
|
|
|
|
|
|
|
do { |
3088
|
|
|
|
|
|
|
|
3089
|
|
|
|
|
|
|
package Mite::Shim; |
3090
|
0
|
0
|
|
|
|
0
|
defined($v) and do { |
3091
|
0
|
0
|
|
|
|
0
|
ref( \$v ) eq 'SCALAR' |
3092
|
|
|
|
|
|
|
or ref( |
3093
|
|
|
|
|
|
|
\( my $val = $v ) ) |
3094
|
|
|
|
|
|
|
eq 'SCALAR'; |
3095
|
|
|
|
|
|
|
} |
3096
|
|
|
|
|
|
|
} |
3097
|
|
|
|
|
|
|
) |
3098
|
|
|
|
|
|
|
&& ( |
3099
|
0
|
0
|
0
|
|
|
0
|
do { |
|
|
|
0
|
|
|
|
|
3100
|
0
|
|
|
|
|
0
|
local $_ = $v; |
3101
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*\z/; |
3102
|
|
|
|
|
|
|
} |
3103
|
|
|
|
|
|
|
) |
3104
|
|
|
|
|
|
|
) |
3105
|
|
|
|
|
|
|
or ( ref($v) eq 'ARRAY' ) |
3106
|
|
|
|
|
|
|
or ( ref($v) eq 'CODE' ) |
3107
|
|
|
|
|
|
|
); |
3108
|
|
|
|
|
|
|
} |
3109
|
|
|
|
|
|
|
}; |
3110
|
0
|
|
|
|
|
0
|
for my $k ( keys %{$value} ) { |
|
0
|
|
|
|
|
0
|
|
3111
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
3112
|
|
|
|
|
|
|
|
3113
|
|
|
|
|
|
|
package Mite::Shim; |
3114
|
|
|
|
|
|
|
( |
3115
|
|
|
|
|
|
|
( |
3116
|
|
|
|
|
|
|
( |
3117
|
|
|
|
|
|
|
do { |
3118
|
|
|
|
|
|
|
|
3119
|
|
|
|
|
|
|
package Mite::Shim; |
3120
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
3121
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq 'SCALAR' |
3122
|
|
|
|
|
|
|
or ref( |
3123
|
|
|
|
|
|
|
\( my $val = $k ) ) |
3124
|
|
|
|
|
|
|
eq 'SCALAR'; |
3125
|
|
|
|
|
|
|
} |
3126
|
|
|
|
|
|
|
} |
3127
|
|
|
|
|
|
|
) |
3128
|
|
|
|
|
|
|
&& ( |
3129
|
|
|
|
|
|
|
do { |
3130
|
0
|
|
|
|
|
0
|
local $_ = $k; |
3131
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*\z/; |
3132
|
|
|
|
|
|
|
} |
3133
|
|
|
|
|
|
|
) |
3134
|
|
|
|
|
|
|
) |
3135
|
|
|
|
|
|
|
or ( |
3136
|
|
|
|
|
|
|
( |
3137
|
|
|
|
|
|
|
do { |
3138
|
|
|
|
|
|
|
|
3139
|
|
|
|
|
|
|
package Mite::Shim; |
3140
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
3141
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq 'SCALAR' |
3142
|
|
|
|
|
|
|
or ref( |
3143
|
|
|
|
|
|
|
\( my $val = $k ) ) |
3144
|
|
|
|
|
|
|
eq 'SCALAR'; |
3145
|
|
|
|
|
|
|
} |
3146
|
|
|
|
|
|
|
} |
3147
|
|
|
|
|
|
|
) |
3148
|
0
|
0
|
0
|
|
|
0
|
&& ( do { local $_ = $k; /\%/ } ) |
|
0
|
|
0
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
3149
|
|
|
|
|
|
|
) |
3150
|
|
|
|
|
|
|
); |
3151
|
|
|
|
|
|
|
} |
3152
|
|
|
|
|
|
|
}; |
3153
|
0
|
|
|
|
|
0
|
$ok; |
3154
|
|
|
|
|
|
|
} |
3155
|
|
|
|
|
|
|
} |
3156
|
0
|
0
|
|
|
|
0
|
or do { |
3157
|
|
|
|
|
|
|
|
3158
|
|
|
|
|
|
|
package Mite::Shim; |
3159
|
0
|
0
|
0
|
|
|
0
|
( defined($value) |
3160
|
|
|
|
|
|
|
and !ref($value) |
3161
|
|
|
|
|
|
|
and $value =~ m{\A(?:[12])\z} ); |
3162
|
|
|
|
|
|
|
} |
3163
|
|
|
|
|
|
|
); |
3164
|
|
|
|
|
|
|
} |
3165
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
3166
|
|
|
|
|
|
|
"accessor", "HandlesHash|Enum[\"1\",\"2\"]" ); |
3167
|
0
|
|
|
|
|
0
|
$_[0]{"handles"} = $value; |
3168
|
0
|
|
|
|
|
0
|
$_[0]; |
3169
|
|
|
|
|
|
|
} |
3170
|
24
|
50
|
|
24
|
0
|
158
|
: ( $_[0]{"handles"} ); |
3171
|
|
|
|
|
|
|
} |
3172
|
|
|
|
|
|
|
|
3173
|
|
|
|
|
|
|
# Accessors for handles_via |
3174
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 160 |
3175
|
|
|
|
|
|
|
if ($__XS) { |
3176
|
|
|
|
|
|
|
Class::XSAccessor->import( |
3177
|
|
|
|
|
|
|
chained => 1, |
3178
|
|
|
|
|
|
|
"exists_predicates" => { "has_handles_via" => "handles_via" }, |
3179
|
|
|
|
|
|
|
); |
3180
|
|
|
|
|
|
|
} |
3181
|
|
|
|
|
|
|
else { |
3182
|
|
|
|
|
|
|
*has_handles_via = sub { |
3183
|
|
|
|
|
|
|
@_ == 1 |
3184
|
|
|
|
|
|
|
or croak( |
3185
|
|
|
|
|
|
|
'Predicate "has_handles_via" usage: $self->has_handles_via()'); |
3186
|
|
|
|
|
|
|
exists $_[0]{"handles_via"}; |
3187
|
|
|
|
|
|
|
}; |
3188
|
|
|
|
|
|
|
} |
3189
|
|
|
|
|
|
|
|
3190
|
|
|
|
|
|
|
sub handles_via { |
3191
|
|
|
|
|
|
|
@_ > 1 |
3192
|
|
|
|
|
|
|
? do { |
3193
|
0
|
|
|
|
|
0
|
my $value = do { |
3194
|
0
|
|
|
|
|
0
|
my $to_coerce = $_[1]; |
3195
|
|
|
|
|
|
|
( |
3196
|
|
|
|
|
|
|
do { |
3197
|
|
|
|
|
|
|
|
3198
|
|
|
|
|
|
|
package Mite::Shim; |
3199
|
0
|
0
|
|
|
|
0
|
( ref($to_coerce) eq 'ARRAY' ) and do { |
3200
|
0
|
|
|
|
|
0
|
my $ok = 1; |
3201
|
0
|
|
|
|
|
0
|
for my $i ( @{$to_coerce} ) { |
|
0
|
|
|
|
|
0
|
|
3202
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
3203
|
|
|
|
|
|
|
|
3204
|
|
|
|
|
|
|
package Mite::Shim; |
3205
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
3206
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
3207
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
3208
|
|
|
|
|
|
|
'SCALAR'; |
3209
|
|
|
|
|
|
|
} |
3210
|
|
|
|
|
|
|
} |
3211
|
|
|
|
|
|
|
}; |
3212
|
0
|
|
|
|
|
0
|
$ok; |
3213
|
|
|
|
|
|
|
} |
3214
|
|
|
|
|
|
|
} |
3215
|
|
|
|
|
|
|
) ? $to_coerce : ( |
3216
|
|
|
|
|
|
|
do { |
3217
|
|
|
|
|
|
|
|
3218
|
|
|
|
|
|
|
package Mite::Shim; |
3219
|
0
|
0
|
|
|
|
0
|
defined($to_coerce) and do { |
3220
|
0
|
0
|
|
|
|
0
|
ref( \$to_coerce ) eq 'SCALAR' |
3221
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq 'SCALAR'; |
3222
|
|
|
|
|
|
|
} |
3223
|
|
|
|
|
|
|
} |
3224
|
0
|
0
|
|
|
|
0
|
) ? scalar( do { local $_ = $to_coerce; [$_] } ) : $to_coerce; |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
3225
|
|
|
|
|
|
|
}; |
3226
|
0
|
0
|
|
|
|
0
|
do { |
3227
|
|
|
|
|
|
|
|
3228
|
|
|
|
|
|
|
package Mite::Shim; |
3229
|
0
|
0
|
|
|
|
0
|
( ref($value) eq 'ARRAY' ) and do { |
3230
|
0
|
|
|
|
|
0
|
my $ok = 1; |
3231
|
0
|
|
|
|
|
0
|
for my $i ( @{$value} ) { |
|
0
|
|
|
|
|
0
|
|
3232
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
3233
|
|
|
|
|
|
|
|
3234
|
|
|
|
|
|
|
package Mite::Shim; |
3235
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
3236
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
3237
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq 'SCALAR'; |
3238
|
|
|
|
|
|
|
} |
3239
|
|
|
|
|
|
|
} |
3240
|
|
|
|
|
|
|
}; |
3241
|
0
|
|
|
|
|
0
|
$ok; |
3242
|
|
|
|
|
|
|
} |
3243
|
|
|
|
|
|
|
} |
3244
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
3245
|
|
|
|
|
|
|
"accessor", "ArrayRef[Str]" ); |
3246
|
0
|
|
|
|
|
0
|
$_[0]{"handles_via"} = $value; |
3247
|
0
|
|
|
|
|
0
|
$_[0]; |
3248
|
|
|
|
|
|
|
} |
3249
|
4
|
50
|
|
4
|
0
|
32
|
: ( $_[0]{"handles_via"} ); |
3250
|
|
|
|
|
|
|
} |
3251
|
|
|
|
|
|
|
|
3252
|
|
|
|
|
|
|
# Accessors for init_arg |
3253
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 52 |
3254
|
|
|
|
|
|
|
sub init_arg { |
3255
|
|
|
|
|
|
|
@_ > 1 |
3256
|
|
|
|
|
|
|
? do { |
3257
|
0
|
0
|
|
|
|
0
|
do { |
3258
|
|
|
|
|
|
|
|
3259
|
|
|
|
|
|
|
package Mite::Shim; |
3260
|
|
|
|
|
|
|
( |
3261
|
|
|
|
|
|
|
( |
3262
|
|
|
|
|
|
|
( |
3263
|
0
|
0
|
0
|
|
|
0
|
do { |
3264
|
|
|
|
|
|
|
|
3265
|
|
|
|
|
|
|
package Mite::Shim; |
3266
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
3267
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
3268
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq 'SCALAR'; |
3269
|
|
|
|
|
|
|
} |
3270
|
|
|
|
|
|
|
} |
3271
|
|
|
|
|
|
|
) |
3272
|
|
|
|
|
|
|
&& ( length( $_[1] ) > 0 ) |
3273
|
|
|
|
|
|
|
) |
3274
|
|
|
|
|
|
|
or ( !defined( $_[1] ) ) |
3275
|
|
|
|
|
|
|
); |
3276
|
|
|
|
|
|
|
} |
3277
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
3278
|
|
|
|
|
|
|
"accessor", "NonEmptyStr|Undef" ); |
3279
|
0
|
|
|
|
|
0
|
$_[0]{"init_arg"} = $_[1]; |
3280
|
0
|
|
|
|
|
0
|
$_[0]; |
3281
|
|
|
|
|
|
|
} |
3282
|
532
|
50
|
|
532
|
0
|
1289
|
: do { |
3283
|
|
|
|
|
|
|
( |
3284
|
|
|
|
|
|
|
exists( $_[0]{"init_arg"} ) ? $_[0]{"init_arg"} : ( |
3285
|
532
|
100
|
|
|
|
1949
|
$_[0]{"init_arg"} = do { |
3286
|
107
|
|
|
|
|
649
|
my $default_value = |
3287
|
|
|
|
|
|
|
$Mite::Attribute::__init_arg_DEFAULT__->( |
3288
|
|
|
|
|
|
|
$_[0] ); |
3289
|
107
|
50
|
|
|
|
260
|
do { |
3290
|
|
|
|
|
|
|
|
3291
|
|
|
|
|
|
|
package Mite::Shim; |
3292
|
|
|
|
|
|
|
( |
3293
|
|
|
|
|
|
|
( |
3294
|
|
|
|
|
|
|
( |
3295
|
107
|
50
|
33
|
|
|
230
|
do { |
3296
|
|
|
|
|
|
|
|
3297
|
|
|
|
|
|
|
package Mite::Shim; |
3298
|
107
|
50
|
|
|
|
651
|
defined($default_value) and do { |
3299
|
107
|
50
|
|
|
|
1447
|
ref( \$default_value ) eq |
3300
|
|
|
|
|
|
|
'SCALAR' |
3301
|
|
|
|
|
|
|
or ref( |
3302
|
|
|
|
|
|
|
\( |
3303
|
|
|
|
|
|
|
my $val = |
3304
|
|
|
|
|
|
|
$default_value |
3305
|
|
|
|
|
|
|
) |
3306
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3307
|
|
|
|
|
|
|
} |
3308
|
|
|
|
|
|
|
} |
3309
|
|
|
|
|
|
|
) |
3310
|
|
|
|
|
|
|
&& ( length($default_value) > 0 ) |
3311
|
|
|
|
|
|
|
) |
3312
|
|
|
|
|
|
|
or ( !defined($default_value) ) |
3313
|
|
|
|
|
|
|
); |
3314
|
|
|
|
|
|
|
} |
3315
|
|
|
|
|
|
|
or croak( |
3316
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
3317
|
|
|
|
|
|
|
"init_arg", "NonEmptyStr|Undef" ); |
3318
|
107
|
|
|
|
|
835
|
$default_value; |
3319
|
|
|
|
|
|
|
} |
3320
|
|
|
|
|
|
|
) |
3321
|
|
|
|
|
|
|
) |
3322
|
|
|
|
|
|
|
} |
3323
|
|
|
|
|
|
|
} |
3324
|
|
|
|
|
|
|
|
3325
|
|
|
|
|
|
|
# Accessors for is |
3326
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 66 |
3327
|
|
|
|
|
|
|
sub is { |
3328
|
|
|
|
|
|
|
@_ > 1 |
3329
|
|
|
|
|
|
|
? do { |
3330
|
4
|
50
|
|
|
|
9
|
do { |
3331
|
|
|
|
|
|
|
|
3332
|
|
|
|
|
|
|
package Mite::Shim; |
3333
|
4
|
50
|
33
|
|
|
89
|
( defined( $_[1] ) |
3334
|
|
|
|
|
|
|
and !ref( $_[1] ) |
3335
|
|
|
|
|
|
|
and $_[1] =~ |
3336
|
|
|
|
|
|
|
m{\A(?:(?:bare|l(?:azy|ocked)|r(?:wp?|o)))\z} ); |
3337
|
|
|
|
|
|
|
} |
3338
|
|
|
|
|
|
|
or croak( |
3339
|
|
|
|
|
|
|
"Type check failed in %s: value should be %s", |
3340
|
|
|
|
|
|
|
"accessor", |
3341
|
|
|
|
|
|
|
"Enum[\"ro\",\"rw\",\"rwp\",\"lazy\",\"bare\",\"locked\"]" |
3342
|
|
|
|
|
|
|
); |
3343
|
4
|
|
|
|
|
16
|
$_[0]{"is"} = $_[1]; |
3344
|
4
|
|
|
|
|
13
|
$_[0]; |
3345
|
|
|
|
|
|
|
} |
3346
|
955
|
100
|
|
955
|
0
|
7297
|
: ( $_[0]{"is"} ); |
3347
|
|
|
|
|
|
|
} |
3348
|
|
|
|
|
|
|
|
3349
|
|
|
|
|
|
|
# Accessors for isa |
3350
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 77 |
3351
|
|
|
|
|
|
|
if ($__XS) { |
3352
|
|
|
|
|
|
|
Class::XSAccessor->import( |
3353
|
|
|
|
|
|
|
chained => 1, |
3354
|
|
|
|
|
|
|
"getters" => { "_isa" => "isa" }, |
3355
|
|
|
|
|
|
|
); |
3356
|
|
|
|
|
|
|
} |
3357
|
|
|
|
|
|
|
else { |
3358
|
|
|
|
|
|
|
*_isa = sub { |
3359
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "_isa" usage: $self->_isa()'); |
3360
|
|
|
|
|
|
|
$_[0]{"isa"}; |
3361
|
|
|
|
|
|
|
}; |
3362
|
|
|
|
|
|
|
} |
3363
|
|
|
|
|
|
|
|
3364
|
|
|
|
|
|
|
# Accessors for lazy |
3365
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 120 |
3366
|
|
|
|
|
|
|
sub lazy { |
3367
|
|
|
|
|
|
|
@_ > 1 |
3368
|
|
|
|
|
|
|
? do { |
3369
|
|
|
|
|
|
|
( |
3370
|
4
|
50
|
33
|
|
|
94
|
!ref $_[1] |
|
|
|
33
|
|
|
|
|
3371
|
|
|
|
|
|
|
and (!defined $_[1] |
3372
|
|
|
|
|
|
|
or $_[1] eq q() |
3373
|
|
|
|
|
|
|
or $_[1] eq '0' |
3374
|
|
|
|
|
|
|
or $_[1] eq '1' ) |
3375
|
|
|
|
|
|
|
) |
3376
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
3377
|
|
|
|
|
|
|
"accessor", "Bool" ); |
3378
|
4
|
|
|
|
|
16
|
$_[0]{"lazy"} = $_[1]; |
3379
|
4
|
|
|
|
|
13
|
$_[0]; |
3380
|
|
|
|
|
|
|
} |
3381
|
336
|
100
|
|
336
|
0
|
2197
|
: ( $_[0]{"lazy"} ); |
3382
|
|
|
|
|
|
|
} |
3383
|
|
|
|
|
|
|
|
3384
|
|
|
|
|
|
|
# Accessors for local_writer |
3385
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
3386
|
|
|
|
|
|
|
sub local_writer { |
3387
|
|
|
|
|
|
|
@_ > 1 |
3388
|
|
|
|
|
|
|
? do { |
3389
|
1
|
50
|
|
|
|
2
|
do { |
3390
|
|
|
|
|
|
|
|
3391
|
|
|
|
|
|
|
package Mite::Shim; |
3392
|
|
|
|
|
|
|
( |
3393
|
|
|
|
|
|
|
do { |
3394
|
|
|
|
|
|
|
|
3395
|
|
|
|
|
|
|
package Mite::Shim; |
3396
|
|
|
|
|
|
|
( |
3397
|
|
|
|
|
|
|
( |
3398
|
|
|
|
|
|
|
( |
3399
|
|
|
|
|
|
|
do { |
3400
|
|
|
|
|
|
|
|
3401
|
|
|
|
|
|
|
package Mite::Shim; |
3402
|
1
|
50
|
|
|
|
4
|
defined( $_[1] ) and do { |
3403
|
1
|
50
|
|
|
|
6
|
ref( \$_[1] ) eq 'SCALAR' |
3404
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
3405
|
|
|
|
|
|
|
'SCALAR'; |
3406
|
|
|
|
|
|
|
} |
3407
|
|
|
|
|
|
|
} |
3408
|
|
|
|
|
|
|
) |
3409
|
|
|
|
|
|
|
&& ( |
3410
|
1
|
|
|
|
|
10
|
do { local $_ = $_[1]; /\A[^\W0-9]\w*\z/ } |
|
1
|
|
|
|
|
11
|
|
3411
|
|
|
|
|
|
|
) |
3412
|
|
|
|
|
|
|
) |
3413
|
|
|
|
|
|
|
or ( |
3414
|
|
|
|
|
|
|
( |
3415
|
|
|
|
|
|
|
do { |
3416
|
|
|
|
|
|
|
|
3417
|
|
|
|
|
|
|
package Mite::Shim; |
3418
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
3419
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
3420
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
3421
|
|
|
|
|
|
|
'SCALAR'; |
3422
|
|
|
|
|
|
|
} |
3423
|
|
|
|
|
|
|
} |
3424
|
|
|
|
|
|
|
) |
3425
|
|
|
|
|
|
|
&& ( |
3426
|
1
|
50
|
0
|
|
|
1
|
do { local $_ = $_[1]; /\%/ } |
|
0
|
|
33
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
3427
|
|
|
|
|
|
|
) |
3428
|
|
|
|
|
|
|
) |
3429
|
|
|
|
|
|
|
); |
3430
|
|
|
|
|
|
|
} |
3431
|
1
|
0
|
33
|
|
|
2
|
or do { |
3432
|
|
|
|
|
|
|
|
3433
|
|
|
|
|
|
|
package Mite::Shim; |
3434
|
0
|
0
|
0
|
|
|
0
|
( defined( $_[1] ) |
3435
|
|
|
|
|
|
|
and !ref( $_[1] ) |
3436
|
|
|
|
|
|
|
and $_[1] =~ m{\A(?:1)\z} ); |
3437
|
|
|
|
|
|
|
} |
3438
|
|
|
|
|
|
|
or ( !defined( $_[1] ) ) |
3439
|
|
|
|
|
|
|
); |
3440
|
|
|
|
|
|
|
} |
3441
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
3442
|
|
|
|
|
|
|
"accessor", "MethodNameTemplate|One|Undef" ); |
3443
|
1
|
|
|
|
|
3
|
$_[0]{"local_writer"} = $_[1]; |
3444
|
1
|
|
|
|
|
4
|
$_[0]; |
3445
|
|
|
|
|
|
|
} |
3446
|
294
|
100
|
|
294
|
0
|
1027
|
: do { |
3447
|
|
|
|
|
|
|
( |
3448
|
|
|
|
|
|
|
exists( $_[0]{"local_writer"} ) ? $_[0]{"local_writer"} : ( |
3449
|
293
|
100
|
|
|
|
1087
|
$_[0]{"local_writer"} = do { |
3450
|
165
|
|
|
|
|
610
|
my $default_value = $_[0]->_build_local_writer; |
3451
|
165
|
50
|
|
|
|
307
|
do { |
3452
|
|
|
|
|
|
|
|
3453
|
|
|
|
|
|
|
package Mite::Shim; |
3454
|
|
|
|
|
|
|
( |
3455
|
|
|
|
|
|
|
do { |
3456
|
|
|
|
|
|
|
|
3457
|
|
|
|
|
|
|
package Mite::Shim; |
3458
|
|
|
|
|
|
|
( |
3459
|
|
|
|
|
|
|
( |
3460
|
|
|
|
|
|
|
( |
3461
|
|
|
|
|
|
|
do { |
3462
|
|
|
|
|
|
|
|
3463
|
|
|
|
|
|
|
package Mite::Shim; |
3464
|
|
|
|
|
|
|
defined($default_value) |
3465
|
165
|
50
|
|
|
|
1346
|
and do { |
3466
|
0
|
0
|
|
|
|
0
|
ref( \$default_value ) |
3467
|
|
|
|
|
|
|
eq 'SCALAR' |
3468
|
|
|
|
|
|
|
or ref( |
3469
|
|
|
|
|
|
|
\( |
3470
|
|
|
|
|
|
|
my $val = |
3471
|
|
|
|
|
|
|
$default_value |
3472
|
|
|
|
|
|
|
) |
3473
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3474
|
|
|
|
|
|
|
} |
3475
|
|
|
|
|
|
|
} |
3476
|
|
|
|
|
|
|
) |
3477
|
|
|
|
|
|
|
&& ( |
3478
|
|
|
|
|
|
|
do { |
3479
|
0
|
|
|
|
|
0
|
local $_ = $default_value; |
3480
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*\z/; |
3481
|
|
|
|
|
|
|
} |
3482
|
|
|
|
|
|
|
) |
3483
|
|
|
|
|
|
|
) |
3484
|
|
|
|
|
|
|
or ( |
3485
|
|
|
|
|
|
|
( |
3486
|
|
|
|
|
|
|
do { |
3487
|
|
|
|
|
|
|
|
3488
|
|
|
|
|
|
|
package Mite::Shim; |
3489
|
|
|
|
|
|
|
defined($default_value) |
3490
|
165
|
50
|
|
|
|
1408
|
and do { |
3491
|
0
|
0
|
|
|
|
0
|
ref( \$default_value ) |
3492
|
|
|
|
|
|
|
eq 'SCALAR' |
3493
|
|
|
|
|
|
|
or ref( |
3494
|
|
|
|
|
|
|
\( |
3495
|
|
|
|
|
|
|
my $val = |
3496
|
|
|
|
|
|
|
$default_value |
3497
|
|
|
|
|
|
|
) |
3498
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3499
|
|
|
|
|
|
|
} |
3500
|
|
|
|
|
|
|
} |
3501
|
|
|
|
|
|
|
) |
3502
|
|
|
|
|
|
|
&& ( |
3503
|
165
|
50
|
33
|
|
|
272
|
do { |
|
|
|
33
|
|
|
|
|
3504
|
0
|
|
|
|
|
0
|
local $_ = $default_value; |
3505
|
0
|
|
|
|
|
0
|
/\%/; |
3506
|
|
|
|
|
|
|
} |
3507
|
|
|
|
|
|
|
) |
3508
|
|
|
|
|
|
|
) |
3509
|
|
|
|
|
|
|
); |
3510
|
|
|
|
|
|
|
} |
3511
|
165
|
50
|
33
|
|
|
353
|
or do { |
3512
|
|
|
|
|
|
|
|
3513
|
|
|
|
|
|
|
package Mite::Shim; |
3514
|
165
|
50
|
33
|
|
|
1514
|
( defined($default_value) |
3515
|
|
|
|
|
|
|
and !ref($default_value) |
3516
|
|
|
|
|
|
|
and $default_value =~ m{\A(?:1)\z} ); |
3517
|
|
|
|
|
|
|
} |
3518
|
|
|
|
|
|
|
or ( !defined($default_value) ) |
3519
|
|
|
|
|
|
|
); |
3520
|
|
|
|
|
|
|
} |
3521
|
|
|
|
|
|
|
or croak( |
3522
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
3523
|
|
|
|
|
|
|
"local_writer", |
3524
|
|
|
|
|
|
|
"MethodNameTemplate|One|Undef" |
3525
|
|
|
|
|
|
|
); |
3526
|
165
|
|
|
|
|
800
|
$default_value; |
3527
|
|
|
|
|
|
|
} |
3528
|
|
|
|
|
|
|
) |
3529
|
|
|
|
|
|
|
) |
3530
|
|
|
|
|
|
|
} |
3531
|
|
|
|
|
|
|
} |
3532
|
|
|
|
|
|
|
|
3533
|
|
|
|
|
|
|
# Accessors for locked |
3534
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 102 |
3535
|
|
|
|
|
|
|
sub locked { |
3536
|
|
|
|
|
|
|
@_ > 1 |
3537
|
|
|
|
|
|
|
? do { |
3538
|
|
|
|
|
|
|
( |
3539
|
0
|
0
|
0
|
|
|
0
|
!ref $_[1] |
|
|
|
0
|
|
|
|
|
3540
|
|
|
|
|
|
|
and (!defined $_[1] |
3541
|
|
|
|
|
|
|
or $_[1] eq q() |
3542
|
|
|
|
|
|
|
or $_[1] eq '0' |
3543
|
|
|
|
|
|
|
or $_[1] eq '1' ) |
3544
|
|
|
|
|
|
|
) |
3545
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
3546
|
|
|
|
|
|
|
"accessor", "Bool" ); |
3547
|
0
|
|
|
|
|
0
|
$_[0]{"locked"} = $_[1]; |
3548
|
0
|
|
|
|
|
0
|
$_[0]; |
3549
|
|
|
|
|
|
|
} |
3550
|
321
|
50
|
|
321
|
0
|
1892
|
: ( $_[0]{"locked"} ); |
3551
|
|
|
|
|
|
|
} |
3552
|
|
|
|
|
|
|
|
3553
|
|
|
|
|
|
|
# Accessors for lvalue |
3554
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
3555
|
|
|
|
|
|
|
sub lvalue { |
3556
|
|
|
|
|
|
|
@_ > 1 |
3557
|
|
|
|
|
|
|
? do { |
3558
|
9
|
50
|
|
|
|
15
|
do { |
3559
|
|
|
|
|
|
|
|
3560
|
|
|
|
|
|
|
package Mite::Shim; |
3561
|
|
|
|
|
|
|
( |
3562
|
|
|
|
|
|
|
do { |
3563
|
|
|
|
|
|
|
|
3564
|
|
|
|
|
|
|
package Mite::Shim; |
3565
|
|
|
|
|
|
|
( |
3566
|
|
|
|
|
|
|
( |
3567
|
|
|
|
|
|
|
( |
3568
|
|
|
|
|
|
|
do { |
3569
|
|
|
|
|
|
|
|
3570
|
|
|
|
|
|
|
package Mite::Shim; |
3571
|
9
|
50
|
|
|
|
33
|
defined( $_[1] ) and do { |
3572
|
9
|
50
|
|
|
|
65
|
ref( \$_[1] ) eq 'SCALAR' |
3573
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
3574
|
|
|
|
|
|
|
'SCALAR'; |
3575
|
|
|
|
|
|
|
} |
3576
|
|
|
|
|
|
|
} |
3577
|
|
|
|
|
|
|
) |
3578
|
|
|
|
|
|
|
&& ( |
3579
|
9
|
|
|
|
|
22
|
do { local $_ = $_[1]; /\A[^\W0-9]\w*\z/ } |
|
9
|
|
|
|
|
96
|
|
3580
|
|
|
|
|
|
|
) |
3581
|
|
|
|
|
|
|
) |
3582
|
|
|
|
|
|
|
or ( |
3583
|
|
|
|
|
|
|
( |
3584
|
|
|
|
|
|
|
do { |
3585
|
|
|
|
|
|
|
|
3586
|
|
|
|
|
|
|
package Mite::Shim; |
3587
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
3588
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
3589
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
3590
|
|
|
|
|
|
|
'SCALAR'; |
3591
|
|
|
|
|
|
|
} |
3592
|
|
|
|
|
|
|
} |
3593
|
|
|
|
|
|
|
) |
3594
|
|
|
|
|
|
|
&& ( |
3595
|
9
|
50
|
0
|
|
|
13
|
do { local $_ = $_[1]; /\%/ } |
|
0
|
|
33
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
3596
|
|
|
|
|
|
|
) |
3597
|
|
|
|
|
|
|
) |
3598
|
|
|
|
|
|
|
); |
3599
|
|
|
|
|
|
|
} |
3600
|
9
|
0
|
33
|
|
|
23
|
or do { |
3601
|
|
|
|
|
|
|
|
3602
|
|
|
|
|
|
|
package Mite::Shim; |
3603
|
0
|
0
|
0
|
|
|
0
|
( defined( $_[1] ) |
3604
|
|
|
|
|
|
|
and !ref( $_[1] ) |
3605
|
|
|
|
|
|
|
and $_[1] =~ m{\A(?:1)\z} ); |
3606
|
|
|
|
|
|
|
} |
3607
|
|
|
|
|
|
|
or ( !defined( $_[1] ) ) |
3608
|
|
|
|
|
|
|
); |
3609
|
|
|
|
|
|
|
} |
3610
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
3611
|
|
|
|
|
|
|
"accessor", "MethodNameTemplate|One|Undef" ); |
3612
|
9
|
|
|
|
|
24
|
$_[0]{"lvalue"} = $_[1]; |
3613
|
9
|
|
|
|
|
26
|
$_[0]; |
3614
|
|
|
|
|
|
|
} |
3615
|
476
|
100
|
|
476
|
0
|
1364
|
: do { |
3616
|
|
|
|
|
|
|
( |
3617
|
|
|
|
|
|
|
exists( $_[0]{"lvalue"} ) ? $_[0]{"lvalue"} : ( |
3618
|
467
|
100
|
|
|
|
2025
|
$_[0]{"lvalue"} = do { |
3619
|
157
|
|
|
|
|
623
|
my $default_value = $_[0]->_build_lvalue; |
3620
|
157
|
50
|
|
|
|
402
|
do { |
3621
|
|
|
|
|
|
|
|
3622
|
|
|
|
|
|
|
package Mite::Shim; |
3623
|
|
|
|
|
|
|
( |
3624
|
|
|
|
|
|
|
do { |
3625
|
|
|
|
|
|
|
|
3626
|
|
|
|
|
|
|
package Mite::Shim; |
3627
|
|
|
|
|
|
|
( |
3628
|
|
|
|
|
|
|
( |
3629
|
|
|
|
|
|
|
( |
3630
|
|
|
|
|
|
|
do { |
3631
|
|
|
|
|
|
|
|
3632
|
|
|
|
|
|
|
package Mite::Shim; |
3633
|
|
|
|
|
|
|
defined($default_value) |
3634
|
157
|
50
|
|
|
|
1271
|
and do { |
3635
|
0
|
0
|
|
|
|
0
|
ref( \$default_value ) |
3636
|
|
|
|
|
|
|
eq 'SCALAR' |
3637
|
|
|
|
|
|
|
or ref( |
3638
|
|
|
|
|
|
|
\( |
3639
|
|
|
|
|
|
|
my $val = |
3640
|
|
|
|
|
|
|
$default_value |
3641
|
|
|
|
|
|
|
) |
3642
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3643
|
|
|
|
|
|
|
} |
3644
|
|
|
|
|
|
|
} |
3645
|
|
|
|
|
|
|
) |
3646
|
|
|
|
|
|
|
&& ( |
3647
|
|
|
|
|
|
|
do { |
3648
|
0
|
|
|
|
|
0
|
local $_ = $default_value; |
3649
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*\z/; |
3650
|
|
|
|
|
|
|
} |
3651
|
|
|
|
|
|
|
) |
3652
|
|
|
|
|
|
|
) |
3653
|
|
|
|
|
|
|
or ( |
3654
|
|
|
|
|
|
|
( |
3655
|
|
|
|
|
|
|
do { |
3656
|
|
|
|
|
|
|
|
3657
|
|
|
|
|
|
|
package Mite::Shim; |
3658
|
|
|
|
|
|
|
defined($default_value) |
3659
|
157
|
50
|
|
|
|
1319
|
and do { |
3660
|
0
|
0
|
|
|
|
0
|
ref( \$default_value ) |
3661
|
|
|
|
|
|
|
eq 'SCALAR' |
3662
|
|
|
|
|
|
|
or ref( |
3663
|
|
|
|
|
|
|
\( |
3664
|
|
|
|
|
|
|
my $val = |
3665
|
|
|
|
|
|
|
$default_value |
3666
|
|
|
|
|
|
|
) |
3667
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3668
|
|
|
|
|
|
|
} |
3669
|
|
|
|
|
|
|
} |
3670
|
|
|
|
|
|
|
) |
3671
|
|
|
|
|
|
|
&& ( |
3672
|
157
|
50
|
33
|
|
|
303
|
do { |
|
|
|
33
|
|
|
|
|
3673
|
0
|
|
|
|
|
0
|
local $_ = $default_value; |
3674
|
0
|
|
|
|
|
0
|
/\%/; |
3675
|
|
|
|
|
|
|
} |
3676
|
|
|
|
|
|
|
) |
3677
|
|
|
|
|
|
|
) |
3678
|
|
|
|
|
|
|
); |
3679
|
|
|
|
|
|
|
} |
3680
|
157
|
50
|
33
|
|
|
364
|
or do { |
3681
|
|
|
|
|
|
|
|
3682
|
|
|
|
|
|
|
package Mite::Shim; |
3683
|
157
|
50
|
33
|
|
|
1457
|
( defined($default_value) |
3684
|
|
|
|
|
|
|
and !ref($default_value) |
3685
|
|
|
|
|
|
|
and $default_value =~ m{\A(?:1)\z} ); |
3686
|
|
|
|
|
|
|
} |
3687
|
|
|
|
|
|
|
or ( !defined($default_value) ) |
3688
|
|
|
|
|
|
|
); |
3689
|
|
|
|
|
|
|
} |
3690
|
|
|
|
|
|
|
or croak( |
3691
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
3692
|
|
|
|
|
|
|
"lvalue", |
3693
|
|
|
|
|
|
|
"MethodNameTemplate|One|Undef" |
3694
|
|
|
|
|
|
|
); |
3695
|
157
|
|
|
|
|
754
|
$default_value; |
3696
|
|
|
|
|
|
|
} |
3697
|
|
|
|
|
|
|
) |
3698
|
|
|
|
|
|
|
) |
3699
|
|
|
|
|
|
|
} |
3700
|
|
|
|
|
|
|
} |
3701
|
|
|
|
|
|
|
|
3702
|
|
|
|
|
|
|
# Accessors for name |
3703
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 43 |
3704
|
|
|
|
|
|
|
sub name { |
3705
|
|
|
|
|
|
|
@_ > 1 |
3706
|
|
|
|
|
|
|
? do { |
3707
|
|
|
|
|
|
|
( |
3708
|
|
|
|
|
|
|
( |
3709
|
0
|
0
|
0
|
|
|
0
|
do { |
3710
|
|
|
|
|
|
|
|
3711
|
|
|
|
|
|
|
package Mite::Shim; |
3712
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
3713
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
3714
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq 'SCALAR'; |
3715
|
|
|
|
|
|
|
} |
3716
|
|
|
|
|
|
|
} |
3717
|
|
|
|
|
|
|
) |
3718
|
|
|
|
|
|
|
&& ( length( $_[1] ) > 0 ) |
3719
|
|
|
|
|
|
|
) |
3720
|
|
|
|
|
|
|
or croak( |
3721
|
|
|
|
|
|
|
"Type check failed in %s: value should be %s", |
3722
|
|
|
|
|
|
|
"accessor", |
3723
|
|
|
|
|
|
|
"NonEmptyStr" |
3724
|
|
|
|
|
|
|
); |
3725
|
0
|
|
|
|
|
0
|
$_[0]{"name"} = $_[1]; |
3726
|
0
|
|
|
|
|
0
|
$_[0]; |
3727
|
|
|
|
|
|
|
} |
3728
|
1601
|
50
|
|
1601
|
0
|
26480
|
: ( $_[0]{"name"} ); |
3729
|
|
|
|
|
|
|
} |
3730
|
|
|
|
|
|
|
|
3731
|
|
|
|
|
|
|
# Accessors for predicate |
3732
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
3733
|
|
|
|
|
|
|
sub predicate { |
3734
|
|
|
|
|
|
|
@_ > 1 |
3735
|
|
|
|
|
|
|
? do { |
3736
|
4
|
50
|
|
|
|
25
|
do { |
3737
|
|
|
|
|
|
|
|
3738
|
|
|
|
|
|
|
package Mite::Shim; |
3739
|
|
|
|
|
|
|
( |
3740
|
|
|
|
|
|
|
do { |
3741
|
|
|
|
|
|
|
|
3742
|
|
|
|
|
|
|
package Mite::Shim; |
3743
|
|
|
|
|
|
|
( |
3744
|
|
|
|
|
|
|
( |
3745
|
|
|
|
|
|
|
( |
3746
|
|
|
|
|
|
|
do { |
3747
|
|
|
|
|
|
|
|
3748
|
|
|
|
|
|
|
package Mite::Shim; |
3749
|
4
|
50
|
|
|
|
40
|
defined( $_[1] ) and do { |
3750
|
4
|
50
|
|
|
|
61
|
ref( \$_[1] ) eq 'SCALAR' |
3751
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
3752
|
|
|
|
|
|
|
'SCALAR'; |
3753
|
|
|
|
|
|
|
} |
3754
|
|
|
|
|
|
|
} |
3755
|
|
|
|
|
|
|
) |
3756
|
|
|
|
|
|
|
&& ( |
3757
|
4
|
|
|
|
|
15
|
do { local $_ = $_[1]; /\A[^\W0-9]\w*\z/ } |
|
4
|
|
|
|
|
68
|
|
3758
|
|
|
|
|
|
|
) |
3759
|
|
|
|
|
|
|
) |
3760
|
|
|
|
|
|
|
or ( |
3761
|
|
|
|
|
|
|
( |
3762
|
|
|
|
|
|
|
do { |
3763
|
|
|
|
|
|
|
|
3764
|
|
|
|
|
|
|
package Mite::Shim; |
3765
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
3766
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
3767
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
3768
|
|
|
|
|
|
|
'SCALAR'; |
3769
|
|
|
|
|
|
|
} |
3770
|
|
|
|
|
|
|
} |
3771
|
|
|
|
|
|
|
) |
3772
|
|
|
|
|
|
|
&& ( |
3773
|
4
|
50
|
0
|
|
|
14
|
do { local $_ = $_[1]; /\%/ } |
|
0
|
|
33
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
3774
|
|
|
|
|
|
|
) |
3775
|
|
|
|
|
|
|
) |
3776
|
|
|
|
|
|
|
); |
3777
|
|
|
|
|
|
|
} |
3778
|
4
|
0
|
33
|
|
|
12
|
or do { |
3779
|
|
|
|
|
|
|
|
3780
|
|
|
|
|
|
|
package Mite::Shim; |
3781
|
0
|
0
|
0
|
|
|
0
|
( defined( $_[1] ) |
3782
|
|
|
|
|
|
|
and !ref( $_[1] ) |
3783
|
|
|
|
|
|
|
and $_[1] =~ m{\A(?:1)\z} ); |
3784
|
|
|
|
|
|
|
} |
3785
|
|
|
|
|
|
|
or ( !defined( $_[1] ) ) |
3786
|
|
|
|
|
|
|
); |
3787
|
|
|
|
|
|
|
} |
3788
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
3789
|
|
|
|
|
|
|
"accessor", "MethodNameTemplate|One|Undef" ); |
3790
|
4
|
|
|
|
|
17
|
$_[0]{"predicate"} = $_[1]; |
3791
|
4
|
|
|
|
|
14
|
$_[0]; |
3792
|
|
|
|
|
|
|
} |
3793
|
300
|
100
|
|
300
|
0
|
981
|
: do { |
3794
|
|
|
|
|
|
|
( |
3795
|
|
|
|
|
|
|
exists( $_[0]{"predicate"} ) ? $_[0]{"predicate"} : ( |
3796
|
296
|
100
|
|
|
|
979
|
$_[0]{"predicate"} = do { |
3797
|
163
|
|
|
|
|
610
|
my $default_value = $_[0]->_build_predicate; |
3798
|
163
|
50
|
|
|
|
335
|
do { |
3799
|
|
|
|
|
|
|
|
3800
|
|
|
|
|
|
|
package Mite::Shim; |
3801
|
|
|
|
|
|
|
( |
3802
|
|
|
|
|
|
|
do { |
3803
|
|
|
|
|
|
|
|
3804
|
|
|
|
|
|
|
package Mite::Shim; |
3805
|
|
|
|
|
|
|
( |
3806
|
|
|
|
|
|
|
( |
3807
|
|
|
|
|
|
|
( |
3808
|
|
|
|
|
|
|
do { |
3809
|
|
|
|
|
|
|
|
3810
|
|
|
|
|
|
|
package Mite::Shim; |
3811
|
|
|
|
|
|
|
defined($default_value) |
3812
|
163
|
50
|
|
|
|
1209
|
and do { |
3813
|
0
|
0
|
|
|
|
0
|
ref( \$default_value ) |
3814
|
|
|
|
|
|
|
eq 'SCALAR' |
3815
|
|
|
|
|
|
|
or ref( |
3816
|
|
|
|
|
|
|
\( |
3817
|
|
|
|
|
|
|
my $val = |
3818
|
|
|
|
|
|
|
$default_value |
3819
|
|
|
|
|
|
|
) |
3820
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3821
|
|
|
|
|
|
|
} |
3822
|
|
|
|
|
|
|
} |
3823
|
|
|
|
|
|
|
) |
3824
|
|
|
|
|
|
|
&& ( |
3825
|
|
|
|
|
|
|
do { |
3826
|
0
|
|
|
|
|
0
|
local $_ = $default_value; |
3827
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*\z/; |
3828
|
|
|
|
|
|
|
} |
3829
|
|
|
|
|
|
|
) |
3830
|
|
|
|
|
|
|
) |
3831
|
|
|
|
|
|
|
or ( |
3832
|
|
|
|
|
|
|
( |
3833
|
|
|
|
|
|
|
do { |
3834
|
|
|
|
|
|
|
|
3835
|
|
|
|
|
|
|
package Mite::Shim; |
3836
|
|
|
|
|
|
|
defined($default_value) |
3837
|
163
|
50
|
|
|
|
1391
|
and do { |
3838
|
0
|
0
|
|
|
|
0
|
ref( \$default_value ) |
3839
|
|
|
|
|
|
|
eq 'SCALAR' |
3840
|
|
|
|
|
|
|
or ref( |
3841
|
|
|
|
|
|
|
\( |
3842
|
|
|
|
|
|
|
my $val = |
3843
|
|
|
|
|
|
|
$default_value |
3844
|
|
|
|
|
|
|
) |
3845
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3846
|
|
|
|
|
|
|
} |
3847
|
|
|
|
|
|
|
} |
3848
|
|
|
|
|
|
|
) |
3849
|
|
|
|
|
|
|
&& ( |
3850
|
163
|
50
|
33
|
|
|
286
|
do { |
|
|
|
33
|
|
|
|
|
3851
|
0
|
|
|
|
|
0
|
local $_ = $default_value; |
3852
|
0
|
|
|
|
|
0
|
/\%/; |
3853
|
|
|
|
|
|
|
} |
3854
|
|
|
|
|
|
|
) |
3855
|
|
|
|
|
|
|
) |
3856
|
|
|
|
|
|
|
); |
3857
|
|
|
|
|
|
|
} |
3858
|
163
|
50
|
33
|
|
|
316
|
or do { |
3859
|
|
|
|
|
|
|
|
3860
|
|
|
|
|
|
|
package Mite::Shim; |
3861
|
163
|
50
|
33
|
|
|
1421
|
( defined($default_value) |
3862
|
|
|
|
|
|
|
and !ref($default_value) |
3863
|
|
|
|
|
|
|
and $default_value =~ m{\A(?:1)\z} ); |
3864
|
|
|
|
|
|
|
} |
3865
|
|
|
|
|
|
|
or ( !defined($default_value) ) |
3866
|
|
|
|
|
|
|
); |
3867
|
|
|
|
|
|
|
} |
3868
|
|
|
|
|
|
|
or croak( |
3869
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
3870
|
|
|
|
|
|
|
"predicate", |
3871
|
|
|
|
|
|
|
"MethodNameTemplate|One|Undef" |
3872
|
|
|
|
|
|
|
); |
3873
|
163
|
|
|
|
|
744
|
$default_value; |
3874
|
|
|
|
|
|
|
} |
3875
|
|
|
|
|
|
|
) |
3876
|
|
|
|
|
|
|
) |
3877
|
|
|
|
|
|
|
} |
3878
|
|
|
|
|
|
|
} |
3879
|
|
|
|
|
|
|
|
3880
|
|
|
|
|
|
|
# Accessors for reader |
3881
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
3882
|
|
|
|
|
|
|
sub reader { |
3883
|
|
|
|
|
|
|
@_ > 1 |
3884
|
|
|
|
|
|
|
? do { |
3885
|
3
|
50
|
|
|
|
10
|
do { |
3886
|
|
|
|
|
|
|
|
3887
|
|
|
|
|
|
|
package Mite::Shim; |
3888
|
|
|
|
|
|
|
( |
3889
|
|
|
|
|
|
|
do { |
3890
|
|
|
|
|
|
|
|
3891
|
|
|
|
|
|
|
package Mite::Shim; |
3892
|
|
|
|
|
|
|
( |
3893
|
|
|
|
|
|
|
( |
3894
|
|
|
|
|
|
|
( |
3895
|
|
|
|
|
|
|
do { |
3896
|
|
|
|
|
|
|
|
3897
|
|
|
|
|
|
|
package Mite::Shim; |
3898
|
3
|
50
|
|
|
|
52
|
defined( $_[1] ) and do { |
3899
|
3
|
50
|
|
|
|
61
|
ref( \$_[1] ) eq 'SCALAR' |
3900
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
3901
|
|
|
|
|
|
|
'SCALAR'; |
3902
|
|
|
|
|
|
|
} |
3903
|
|
|
|
|
|
|
} |
3904
|
|
|
|
|
|
|
) |
3905
|
|
|
|
|
|
|
&& ( |
3906
|
3
|
|
|
|
|
12
|
do { local $_ = $_[1]; /\A[^\W0-9]\w*\z/ } |
|
3
|
|
|
|
|
84
|
|
3907
|
|
|
|
|
|
|
) |
3908
|
|
|
|
|
|
|
) |
3909
|
|
|
|
|
|
|
or ( |
3910
|
|
|
|
|
|
|
( |
3911
|
|
|
|
|
|
|
do { |
3912
|
|
|
|
|
|
|
|
3913
|
|
|
|
|
|
|
package Mite::Shim; |
3914
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
3915
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
3916
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
3917
|
|
|
|
|
|
|
'SCALAR'; |
3918
|
|
|
|
|
|
|
} |
3919
|
|
|
|
|
|
|
} |
3920
|
|
|
|
|
|
|
) |
3921
|
|
|
|
|
|
|
&& ( |
3922
|
3
|
50
|
0
|
|
|
10
|
do { local $_ = $_[1]; /\%/ } |
|
0
|
|
33
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
3923
|
|
|
|
|
|
|
) |
3924
|
|
|
|
|
|
|
) |
3925
|
|
|
|
|
|
|
); |
3926
|
|
|
|
|
|
|
} |
3927
|
3
|
0
|
33
|
|
|
6
|
or do { |
3928
|
|
|
|
|
|
|
|
3929
|
|
|
|
|
|
|
package Mite::Shim; |
3930
|
0
|
0
|
0
|
|
|
0
|
( defined( $_[1] ) |
3931
|
|
|
|
|
|
|
and !ref( $_[1] ) |
3932
|
|
|
|
|
|
|
and $_[1] =~ m{\A(?:1)\z} ); |
3933
|
|
|
|
|
|
|
} |
3934
|
|
|
|
|
|
|
or ( !defined( $_[1] ) ) |
3935
|
|
|
|
|
|
|
); |
3936
|
|
|
|
|
|
|
} |
3937
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
3938
|
|
|
|
|
|
|
"accessor", "MethodNameTemplate|One|Undef" ); |
3939
|
3
|
|
|
|
|
20
|
$_[0]{"reader"} = $_[1]; |
3940
|
3
|
|
|
|
|
14
|
$_[0]; |
3941
|
|
|
|
|
|
|
} |
3942
|
303
|
100
|
|
303
|
0
|
1058
|
: do { |
3943
|
|
|
|
|
|
|
( |
3944
|
|
|
|
|
|
|
exists( $_[0]{"reader"} ) ? $_[0]{"reader"} : ( |
3945
|
300
|
100
|
|
|
|
1049
|
$_[0]{"reader"} = do { |
3946
|
163
|
|
|
|
|
780
|
my $default_value = $_[0]->_build_reader; |
3947
|
163
|
50
|
|
|
|
357
|
do { |
3948
|
|
|
|
|
|
|
|
3949
|
|
|
|
|
|
|
package Mite::Shim; |
3950
|
|
|
|
|
|
|
( |
3951
|
|
|
|
|
|
|
do { |
3952
|
|
|
|
|
|
|
|
3953
|
|
|
|
|
|
|
package Mite::Shim; |
3954
|
|
|
|
|
|
|
( |
3955
|
|
|
|
|
|
|
( |
3956
|
|
|
|
|
|
|
( |
3957
|
|
|
|
|
|
|
do { |
3958
|
|
|
|
|
|
|
|
3959
|
|
|
|
|
|
|
package Mite::Shim; |
3960
|
|
|
|
|
|
|
defined($default_value) |
3961
|
163
|
100
|
|
|
|
1283
|
and do { |
3962
|
51
|
50
|
|
|
|
539
|
ref( \$default_value ) |
3963
|
|
|
|
|
|
|
eq 'SCALAR' |
3964
|
|
|
|
|
|
|
or ref( |
3965
|
|
|
|
|
|
|
\( |
3966
|
|
|
|
|
|
|
my $val = |
3967
|
|
|
|
|
|
|
$default_value |
3968
|
|
|
|
|
|
|
) |
3969
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3970
|
|
|
|
|
|
|
} |
3971
|
|
|
|
|
|
|
} |
3972
|
|
|
|
|
|
|
) |
3973
|
|
|
|
|
|
|
&& ( |
3974
|
|
|
|
|
|
|
do { |
3975
|
51
|
|
|
|
|
180
|
local $_ = $default_value; |
3976
|
51
|
|
|
|
|
651
|
/\A[^\W0-9]\w*\z/; |
3977
|
|
|
|
|
|
|
} |
3978
|
|
|
|
|
|
|
) |
3979
|
|
|
|
|
|
|
) |
3980
|
|
|
|
|
|
|
or ( |
3981
|
|
|
|
|
|
|
( |
3982
|
|
|
|
|
|
|
do { |
3983
|
|
|
|
|
|
|
|
3984
|
|
|
|
|
|
|
package Mite::Shim; |
3985
|
|
|
|
|
|
|
defined($default_value) |
3986
|
163
|
100
|
|
|
|
1199
|
and do { |
3987
|
51
|
50
|
|
|
|
367
|
ref( \$default_value ) |
3988
|
|
|
|
|
|
|
eq 'SCALAR' |
3989
|
|
|
|
|
|
|
or ref( |
3990
|
|
|
|
|
|
|
\( |
3991
|
|
|
|
|
|
|
my $val = |
3992
|
|
|
|
|
|
|
$default_value |
3993
|
|
|
|
|
|
|
) |
3994
|
|
|
|
|
|
|
) eq 'SCALAR'; |
3995
|
|
|
|
|
|
|
} |
3996
|
|
|
|
|
|
|
} |
3997
|
|
|
|
|
|
|
) |
3998
|
|
|
|
|
|
|
&& ( |
3999
|
163
|
50
|
66
|
|
|
366
|
do { |
|
|
|
66
|
|
|
|
|
4000
|
51
|
|
|
|
|
134
|
local $_ = $default_value; |
4001
|
51
|
|
|
|
|
501
|
/\%/; |
4002
|
|
|
|
|
|
|
} |
4003
|
|
|
|
|
|
|
) |
4004
|
|
|
|
|
|
|
) |
4005
|
|
|
|
|
|
|
); |
4006
|
|
|
|
|
|
|
} |
4007
|
163
|
50
|
66
|
|
|
339
|
or do { |
4008
|
|
|
|
|
|
|
|
4009
|
|
|
|
|
|
|
package Mite::Shim; |
4010
|
112
|
50
|
33
|
|
|
1057
|
( defined($default_value) |
4011
|
|
|
|
|
|
|
and !ref($default_value) |
4012
|
|
|
|
|
|
|
and $default_value =~ m{\A(?:1)\z} ); |
4013
|
|
|
|
|
|
|
} |
4014
|
|
|
|
|
|
|
or ( !defined($default_value) ) |
4015
|
|
|
|
|
|
|
); |
4016
|
|
|
|
|
|
|
} |
4017
|
|
|
|
|
|
|
or croak( |
4018
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
4019
|
|
|
|
|
|
|
"reader", |
4020
|
|
|
|
|
|
|
"MethodNameTemplate|One|Undef" |
4021
|
|
|
|
|
|
|
); |
4022
|
163
|
|
|
|
|
1012
|
$default_value; |
4023
|
|
|
|
|
|
|
} |
4024
|
|
|
|
|
|
|
) |
4025
|
|
|
|
|
|
|
) |
4026
|
|
|
|
|
|
|
} |
4027
|
|
|
|
|
|
|
} |
4028
|
|
|
|
|
|
|
|
4029
|
|
|
|
|
|
|
# Accessors for required |
4030
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 54 |
4031
|
|
|
|
|
|
|
sub required { |
4032
|
|
|
|
|
|
|
@_ > 1 |
4033
|
|
|
|
|
|
|
? do { |
4034
|
0
|
|
|
|
|
0
|
my $value = do { |
4035
|
0
|
|
|
|
|
0
|
my $to_coerce = $_[1]; |
4036
|
|
|
|
|
|
|
( |
4037
|
|
|
|
|
|
|
( |
4038
|
|
|
|
|
|
|
!ref $to_coerce |
4039
|
|
|
|
|
|
|
and (!defined $to_coerce |
4040
|
|
|
|
|
|
|
or $to_coerce eq q() |
4041
|
|
|
|
|
|
|
or $to_coerce eq '0' |
4042
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
4043
|
|
|
|
|
|
|
) |
4044
|
|
|
|
|
|
|
) ? $to_coerce |
4045
|
0
|
0
|
0
|
|
|
0
|
: ( ( !!1 ) ) ? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
4046
|
|
|
|
|
|
|
: $to_coerce; |
4047
|
|
|
|
|
|
|
}; |
4048
|
|
|
|
|
|
|
( |
4049
|
0
|
0
|
0
|
|
|
0
|
!ref $value |
|
|
|
0
|
|
|
|
|
4050
|
|
|
|
|
|
|
and (!defined $value |
4051
|
|
|
|
|
|
|
or $value eq q() |
4052
|
|
|
|
|
|
|
or $value eq '0' |
4053
|
|
|
|
|
|
|
or $value eq '1' ) |
4054
|
|
|
|
|
|
|
) |
4055
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
4056
|
|
|
|
|
|
|
"accessor", "Bool" ); |
4057
|
0
|
|
|
|
|
0
|
$_[0]{"required"} = $value; |
4058
|
0
|
|
|
|
|
0
|
$_[0]; |
4059
|
|
|
|
|
|
|
} |
4060
|
238
|
50
|
|
238
|
0
|
1933
|
: ( $_[0]{"required"} ); |
4061
|
|
|
|
|
|
|
} |
4062
|
|
|
|
|
|
|
|
4063
|
|
|
|
|
|
|
# Accessors for skip_argc_check |
4064
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 113 |
4065
|
|
|
|
|
|
|
sub skip_argc_check { |
4066
|
|
|
|
|
|
|
@_ > 1 |
4067
|
|
|
|
|
|
|
? do { |
4068
|
0
|
|
|
|
|
0
|
my $value = do { |
4069
|
0
|
|
|
|
|
0
|
my $to_coerce = $_[1]; |
4070
|
|
|
|
|
|
|
( |
4071
|
|
|
|
|
|
|
( |
4072
|
|
|
|
|
|
|
!ref $to_coerce |
4073
|
|
|
|
|
|
|
and (!defined $to_coerce |
4074
|
|
|
|
|
|
|
or $to_coerce eq q() |
4075
|
|
|
|
|
|
|
or $to_coerce eq '0' |
4076
|
|
|
|
|
|
|
or $to_coerce eq '1' ) |
4077
|
|
|
|
|
|
|
) |
4078
|
|
|
|
|
|
|
) ? $to_coerce |
4079
|
0
|
0
|
0
|
|
|
0
|
: ( ( !!1 ) ) ? scalar( do { local $_ = $to_coerce; !!$_ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
4080
|
|
|
|
|
|
|
: $to_coerce; |
4081
|
|
|
|
|
|
|
}; |
4082
|
|
|
|
|
|
|
( |
4083
|
0
|
0
|
0
|
|
|
0
|
!ref $value |
|
|
|
0
|
|
|
|
|
4084
|
|
|
|
|
|
|
and (!defined $value |
4085
|
|
|
|
|
|
|
or $value eq q() |
4086
|
|
|
|
|
|
|
or $value eq '0' |
4087
|
|
|
|
|
|
|
or $value eq '1' ) |
4088
|
|
|
|
|
|
|
) |
4089
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
4090
|
|
|
|
|
|
|
"accessor", "Bool" ); |
4091
|
0
|
|
|
|
|
0
|
$_[0]{"skip_argc_check"} = $value; |
4092
|
0
|
|
|
|
|
0
|
$_[0]; |
4093
|
|
|
|
|
|
|
} |
4094
|
66
|
50
|
|
66
|
0
|
386
|
: ( $_[0]{"skip_argc_check"} ); |
4095
|
|
|
|
|
|
|
} |
4096
|
|
|
|
|
|
|
|
4097
|
|
|
|
|
|
|
# Accessors for trigger |
4098
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 134 |
4099
|
|
|
|
|
|
|
if ($__XS) { |
4100
|
|
|
|
|
|
|
Class::XSAccessor->import( |
4101
|
|
|
|
|
|
|
chained => 1, |
4102
|
|
|
|
|
|
|
"exists_predicates" => { "has_trigger" => "trigger" }, |
4103
|
|
|
|
|
|
|
); |
4104
|
|
|
|
|
|
|
} |
4105
|
|
|
|
|
|
|
else { |
4106
|
|
|
|
|
|
|
*has_trigger = sub { |
4107
|
|
|
|
|
|
|
@_ == 1 |
4108
|
|
|
|
|
|
|
or croak('Predicate "has_trigger" usage: $self->has_trigger()'); |
4109
|
|
|
|
|
|
|
exists $_[0]{"trigger"}; |
4110
|
|
|
|
|
|
|
}; |
4111
|
|
|
|
|
|
|
} |
4112
|
|
|
|
|
|
|
|
4113
|
|
|
|
|
|
|
sub trigger { |
4114
|
|
|
|
|
|
|
@_ > 1 |
4115
|
|
|
|
|
|
|
? do { |
4116
|
7
|
50
|
|
|
|
15
|
do { |
4117
|
|
|
|
|
|
|
|
4118
|
|
|
|
|
|
|
package Mite::Shim; |
4119
|
|
|
|
|
|
|
( |
4120
|
|
|
|
|
|
|
do { |
4121
|
|
|
|
|
|
|
|
4122
|
|
|
|
|
|
|
package Mite::Shim; |
4123
|
|
|
|
|
|
|
( |
4124
|
|
|
|
|
|
|
( |
4125
|
|
|
|
|
|
|
( |
4126
|
|
|
|
|
|
|
do { |
4127
|
|
|
|
|
|
|
|
4128
|
|
|
|
|
|
|
package Mite::Shim; |
4129
|
7
|
50
|
|
|
|
60
|
defined( $_[1] ) and do { |
4130
|
7
|
50
|
|
|
|
67
|
ref( \$_[1] ) eq 'SCALAR' |
4131
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
4132
|
|
|
|
|
|
|
'SCALAR'; |
4133
|
|
|
|
|
|
|
} |
4134
|
|
|
|
|
|
|
} |
4135
|
|
|
|
|
|
|
) |
4136
|
|
|
|
|
|
|
&& ( |
4137
|
7
|
|
|
|
|
25
|
do { local $_ = $_[1]; /\A[^\W0-9]\w*\z/ } |
|
7
|
|
|
|
|
84
|
|
4138
|
|
|
|
|
|
|
) |
4139
|
|
|
|
|
|
|
) |
4140
|
|
|
|
|
|
|
or ( |
4141
|
|
|
|
|
|
|
( |
4142
|
|
|
|
|
|
|
do { |
4143
|
|
|
|
|
|
|
|
4144
|
|
|
|
|
|
|
package Mite::Shim; |
4145
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
4146
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
4147
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
4148
|
|
|
|
|
|
|
'SCALAR'; |
4149
|
|
|
|
|
|
|
} |
4150
|
|
|
|
|
|
|
} |
4151
|
|
|
|
|
|
|
) |
4152
|
|
|
|
|
|
|
&& ( |
4153
|
7
|
50
|
0
|
|
|
21
|
do { local $_ = $_[1]; /\%/ } |
|
0
|
|
33
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
4154
|
|
|
|
|
|
|
) |
4155
|
|
|
|
|
|
|
) |
4156
|
|
|
|
|
|
|
); |
4157
|
|
|
|
|
|
|
} |
4158
|
7
|
0
|
33
|
|
|
17
|
or do { |
4159
|
|
|
|
|
|
|
|
4160
|
|
|
|
|
|
|
package Mite::Shim; |
4161
|
0
|
0
|
0
|
|
|
0
|
( defined( $_[1] ) |
4162
|
|
|
|
|
|
|
and !ref( $_[1] ) |
4163
|
|
|
|
|
|
|
and $_[1] =~ m{\A(?:1)\z} ); |
4164
|
|
|
|
|
|
|
} |
4165
|
|
|
|
|
|
|
or ( ref( $_[1] ) eq 'CODE' ) |
4166
|
|
|
|
|
|
|
); |
4167
|
|
|
|
|
|
|
} |
4168
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
4169
|
|
|
|
|
|
|
"accessor", "MethodNameTemplate|One|CodeRef" ); |
4170
|
7
|
|
|
|
|
28
|
$_[0]{"trigger"} = $_[1]; |
4171
|
7
|
|
|
|
|
23
|
$_[0]; |
4172
|
|
|
|
|
|
|
} |
4173
|
734
|
100
|
|
734
|
0
|
4457
|
: ( $_[0]{"trigger"} ); |
4174
|
|
|
|
|
|
|
} |
4175
|
|
|
|
|
|
|
|
4176
|
|
|
|
|
|
|
# Accessors for type |
4177
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 92 |
4178
|
|
|
|
|
|
|
sub type { |
4179
|
643
|
50
|
|
643
|
0
|
1897
|
@_ == 1 or croak('Reader "type" usage: $self->type()'); |
4180
|
|
|
|
|
|
|
( |
4181
|
|
|
|
|
|
|
exists( $_[0]{"type"} ) ? $_[0]{"type"} : ( |
4182
|
643
|
100
|
|
|
|
3409
|
$_[0]{"type"} = do { |
4183
|
121
|
|
|
|
|
664
|
my $default_value = $_[0]->_build_type; |
4184
|
121
|
50
|
|
|
|
4241
|
do { |
4185
|
|
|
|
|
|
|
|
4186
|
|
|
|
|
|
|
package Mite::Shim; |
4187
|
|
|
|
|
|
|
( |
4188
|
|
|
|
|
|
|
( |
4189
|
121
|
100
|
|
|
|
285
|
do { |
4190
|
|
|
|
|
|
|
|
4191
|
|
|
|
|
|
|
package Mite::Shim; |
4192
|
79
|
|
|
79
|
|
931
|
use Scalar::Util (); |
|
79
|
|
|
|
|
318
|
|
|
79
|
|
|
|
|
74601
|
|
4193
|
121
|
|
|
|
|
1039
|
Scalar::Util::blessed($default_value); |
4194
|
|
|
|
|
|
|
} |
4195
|
|
|
|
|
|
|
) |
4196
|
|
|
|
|
|
|
or ( !defined($default_value) ) |
4197
|
|
|
|
|
|
|
); |
4198
|
|
|
|
|
|
|
} |
4199
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
4200
|
|
|
|
|
|
|
"type", "Object|Undef" ); |
4201
|
121
|
|
|
|
|
750
|
$default_value; |
4202
|
|
|
|
|
|
|
} |
4203
|
|
|
|
|
|
|
) |
4204
|
|
|
|
|
|
|
); |
4205
|
|
|
|
|
|
|
} |
4206
|
|
|
|
|
|
|
|
4207
|
|
|
|
|
|
|
# Accessors for weak_ref |
4208
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 61 |
4209
|
|
|
|
|
|
|
sub weak_ref { |
4210
|
|
|
|
|
|
|
@_ > 1 |
4211
|
|
|
|
|
|
|
? do { |
4212
|
|
|
|
|
|
|
( |
4213
|
0
|
0
|
0
|
|
|
0
|
!ref $_[1] |
|
|
|
0
|
|
|
|
|
4214
|
|
|
|
|
|
|
and (!defined $_[1] |
4215
|
|
|
|
|
|
|
or $_[1] eq q() |
4216
|
|
|
|
|
|
|
or $_[1] eq '0' |
4217
|
|
|
|
|
|
|
or $_[1] eq '1' ) |
4218
|
|
|
|
|
|
|
) |
4219
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
4220
|
|
|
|
|
|
|
"accessor", "Bool" ); |
4221
|
0
|
|
|
|
|
0
|
$_[0]{"weak_ref"} = $_[1]; |
4222
|
0
|
|
|
|
|
0
|
$_[0]; |
4223
|
|
|
|
|
|
|
} |
4224
|
304
|
50
|
|
304
|
0
|
1960
|
: ( $_[0]{"weak_ref"} ); |
4225
|
|
|
|
|
|
|
} |
4226
|
|
|
|
|
|
|
|
4227
|
|
|
|
|
|
|
# Accessors for writer |
4228
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Attribute.pm, line 71 |
4229
|
|
|
|
|
|
|
sub writer { |
4230
|
|
|
|
|
|
|
@_ > 1 |
4231
|
|
|
|
|
|
|
? do { |
4232
|
4
|
50
|
|
|
|
9
|
do { |
4233
|
|
|
|
|
|
|
|
4234
|
|
|
|
|
|
|
package Mite::Shim; |
4235
|
|
|
|
|
|
|
( |
4236
|
|
|
|
|
|
|
do { |
4237
|
|
|
|
|
|
|
|
4238
|
|
|
|
|
|
|
package Mite::Shim; |
4239
|
|
|
|
|
|
|
( |
4240
|
|
|
|
|
|
|
( |
4241
|
|
|
|
|
|
|
( |
4242
|
|
|
|
|
|
|
do { |
4243
|
|
|
|
|
|
|
|
4244
|
|
|
|
|
|
|
package Mite::Shim; |
4245
|
4
|
50
|
|
|
|
46
|
defined( $_[1] ) and do { |
4246
|
4
|
50
|
|
|
|
119
|
ref( \$_[1] ) eq 'SCALAR' |
4247
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
4248
|
|
|
|
|
|
|
'SCALAR'; |
4249
|
|
|
|
|
|
|
} |
4250
|
|
|
|
|
|
|
} |
4251
|
|
|
|
|
|
|
) |
4252
|
|
|
|
|
|
|
&& ( |
4253
|
4
|
|
|
|
|
14
|
do { local $_ = $_[1]; /\A[^\W0-9]\w*\z/ } |
|
4
|
|
|
|
|
67
|
|
4254
|
|
|
|
|
|
|
) |
4255
|
|
|
|
|
|
|
) |
4256
|
|
|
|
|
|
|
or ( |
4257
|
|
|
|
|
|
|
( |
4258
|
|
|
|
|
|
|
do { |
4259
|
|
|
|
|
|
|
|
4260
|
|
|
|
|
|
|
package Mite::Shim; |
4261
|
0
|
0
|
|
|
|
0
|
defined( $_[1] ) and do { |
4262
|
0
|
0
|
|
|
|
0
|
ref( \$_[1] ) eq 'SCALAR' |
4263
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq |
4264
|
|
|
|
|
|
|
'SCALAR'; |
4265
|
|
|
|
|
|
|
} |
4266
|
|
|
|
|
|
|
} |
4267
|
|
|
|
|
|
|
) |
4268
|
|
|
|
|
|
|
&& ( |
4269
|
4
|
50
|
0
|
|
|
11
|
do { local $_ = $_[1]; /\%/ } |
|
0
|
|
33
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
4270
|
|
|
|
|
|
|
) |
4271
|
|
|
|
|
|
|
) |
4272
|
|
|
|
|
|
|
); |
4273
|
|
|
|
|
|
|
} |
4274
|
4
|
0
|
33
|
|
|
11
|
or do { |
4275
|
|
|
|
|
|
|
|
4276
|
|
|
|
|
|
|
package Mite::Shim; |
4277
|
0
|
0
|
0
|
|
|
0
|
( defined( $_[1] ) |
4278
|
|
|
|
|
|
|
and !ref( $_[1] ) |
4279
|
|
|
|
|
|
|
and $_[1] =~ m{\A(?:1)\z} ); |
4280
|
|
|
|
|
|
|
} |
4281
|
|
|
|
|
|
|
or ( !defined( $_[1] ) ) |
4282
|
|
|
|
|
|
|
); |
4283
|
|
|
|
|
|
|
} |
4284
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
4285
|
|
|
|
|
|
|
"accessor", "MethodNameTemplate|One|Undef" ); |
4286
|
4
|
|
|
|
|
13
|
$_[0]{"writer"} = $_[1]; |
4287
|
4
|
|
|
|
|
16
|
$_[0]; |
4288
|
|
|
|
|
|
|
} |
4289
|
302
|
100
|
|
302
|
0
|
1296
|
: do { |
4290
|
|
|
|
|
|
|
( |
4291
|
|
|
|
|
|
|
exists( $_[0]{"writer"} ) ? $_[0]{"writer"} : ( |
4292
|
298
|
100
|
|
|
|
977
|
$_[0]{"writer"} = do { |
4293
|
162
|
|
|
|
|
650
|
my $default_value = $_[0]->_build_writer; |
4294
|
162
|
50
|
|
|
|
331
|
do { |
4295
|
|
|
|
|
|
|
|
4296
|
|
|
|
|
|
|
package Mite::Shim; |
4297
|
|
|
|
|
|
|
( |
4298
|
|
|
|
|
|
|
do { |
4299
|
|
|
|
|
|
|
|
4300
|
|
|
|
|
|
|
package Mite::Shim; |
4301
|
|
|
|
|
|
|
( |
4302
|
|
|
|
|
|
|
( |
4303
|
|
|
|
|
|
|
( |
4304
|
|
|
|
|
|
|
do { |
4305
|
|
|
|
|
|
|
|
4306
|
|
|
|
|
|
|
package Mite::Shim; |
4307
|
|
|
|
|
|
|
defined($default_value) |
4308
|
162
|
100
|
|
|
|
1322
|
and do { |
4309
|
3
|
50
|
|
|
|
24
|
ref( \$default_value ) |
4310
|
|
|
|
|
|
|
eq 'SCALAR' |
4311
|
|
|
|
|
|
|
or ref( |
4312
|
|
|
|
|
|
|
\( |
4313
|
|
|
|
|
|
|
my $val = |
4314
|
|
|
|
|
|
|
$default_value |
4315
|
|
|
|
|
|
|
) |
4316
|
|
|
|
|
|
|
) eq 'SCALAR'; |
4317
|
|
|
|
|
|
|
} |
4318
|
|
|
|
|
|
|
} |
4319
|
|
|
|
|
|
|
) |
4320
|
|
|
|
|
|
|
&& ( |
4321
|
|
|
|
|
|
|
do { |
4322
|
3
|
|
|
|
|
14
|
local $_ = $default_value; |
4323
|
3
|
|
|
|
|
26
|
/\A[^\W0-9]\w*\z/; |
4324
|
|
|
|
|
|
|
} |
4325
|
|
|
|
|
|
|
) |
4326
|
|
|
|
|
|
|
) |
4327
|
|
|
|
|
|
|
or ( |
4328
|
|
|
|
|
|
|
( |
4329
|
|
|
|
|
|
|
do { |
4330
|
|
|
|
|
|
|
|
4331
|
|
|
|
|
|
|
package Mite::Shim; |
4332
|
|
|
|
|
|
|
defined($default_value) |
4333
|
162
|
100
|
|
|
|
10801
|
and do { |
4334
|
3
|
50
|
|
|
|
40
|
ref( \$default_value ) |
4335
|
|
|
|
|
|
|
eq 'SCALAR' |
4336
|
|
|
|
|
|
|
or ref( |
4337
|
|
|
|
|
|
|
\( |
4338
|
|
|
|
|
|
|
my $val = |
4339
|
|
|
|
|
|
|
$default_value |
4340
|
|
|
|
|
|
|
) |
4341
|
|
|
|
|
|
|
) eq 'SCALAR'; |
4342
|
|
|
|
|
|
|
} |
4343
|
|
|
|
|
|
|
} |
4344
|
|
|
|
|
|
|
) |
4345
|
|
|
|
|
|
|
&& ( |
4346
|
162
|
50
|
66
|
|
|
332
|
do { |
|
|
|
66
|
|
|
|
|
4347
|
3
|
|
|
|
|
11
|
local $_ = $default_value; |
4348
|
3
|
|
|
|
|
28
|
/\%/; |
4349
|
|
|
|
|
|
|
} |
4350
|
|
|
|
|
|
|
) |
4351
|
|
|
|
|
|
|
) |
4352
|
|
|
|
|
|
|
); |
4353
|
|
|
|
|
|
|
} |
4354
|
162
|
50
|
66
|
|
|
340
|
or do { |
4355
|
|
|
|
|
|
|
|
4356
|
|
|
|
|
|
|
package Mite::Shim; |
4357
|
159
|
50
|
33
|
|
|
1420
|
( defined($default_value) |
4358
|
|
|
|
|
|
|
and !ref($default_value) |
4359
|
|
|
|
|
|
|
and $default_value =~ m{\A(?:1)\z} ); |
4360
|
|
|
|
|
|
|
} |
4361
|
|
|
|
|
|
|
or ( !defined($default_value) ) |
4362
|
|
|
|
|
|
|
); |
4363
|
|
|
|
|
|
|
} |
4364
|
|
|
|
|
|
|
or croak( |
4365
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
4366
|
|
|
|
|
|
|
"writer", |
4367
|
|
|
|
|
|
|
"MethodNameTemplate|One|Undef" |
4368
|
|
|
|
|
|
|
); |
4369
|
162
|
|
|
|
|
750
|
$default_value; |
4370
|
|
|
|
|
|
|
} |
4371
|
|
|
|
|
|
|
) |
4372
|
|
|
|
|
|
|
) |
4373
|
|
|
|
|
|
|
} |
4374
|
|
|
|
|
|
|
} |
4375
|
|
|
|
|
|
|
|
4376
|
|
|
|
|
|
|
# See UNIVERSAL |
4377
|
|
|
|
|
|
|
sub DOES { |
4378
|
0
|
|
|
0
|
0
|
|
my ( $self, $role ) = @_; |
4379
|
0
|
|
|
|
|
|
our %DOES; |
4380
|
0
|
0
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
4381
|
0
|
0
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
4382
|
0
|
0
|
0
|
|
|
|
if ( $INC{'Moose/Util.pm'} |
|
|
|
0
|
|
|
|
|
4383
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
4384
|
|
|
|
|
|
|
{ |
4385
|
0
|
0
|
0
|
|
|
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
4386
|
|
|
|
|
|
|
} |
4387
|
0
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
4388
|
|
|
|
|
|
|
} |
4389
|
|
|
|
|
|
|
|
4390
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
4391
|
|
|
|
|
|
|
sub does { |
4392
|
0
|
|
|
0
|
0
|
|
shift->DOES(@_); |
4393
|
|
|
|
|
|
|
} |
4394
|
|
|
|
|
|
|
|
4395
|
|
|
|
|
|
|
1; |
4396
|
|
|
|
|
|
|
} |