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