line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
12
|
|
|
12
|
|
678
|
use warnings; |
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
331
|
|
4
|
12
|
|
|
12
|
|
54
|
|
|
12
|
|
|
|
|
18
|
|
|
12
|
|
|
|
|
521
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.48'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use parent 'Specio::Exporter'; |
8
|
12
|
|
|
12
|
|
59
|
|
|
12
|
|
|
|
|
18
|
|
|
12
|
|
|
|
|
75
|
|
9
|
|
|
|
|
|
|
use Specio::Declare; |
10
|
12
|
|
|
12
|
|
775
|
use Specio::Library::Builtins; |
|
12
|
|
|
|
|
23
|
|
|
12
|
|
|
|
|
68
|
|
11
|
12
|
|
|
12
|
|
76
|
|
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
74
|
|
12
|
|
|
|
|
|
|
declare( |
13
|
|
|
|
|
|
|
'PositiveNum', |
14
|
|
|
|
|
|
|
parent => t('Num'), |
15
|
|
|
|
|
|
|
inline => sub { |
16
|
|
|
|
|
|
|
return |
17
|
|
|
|
|
|
|
sprintf( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] ); |
18
|
|
|
|
|
|
|
( |
19
|
|
|
|
|
|
|
%s |
20
|
|
|
|
|
|
|
&& |
21
|
|
|
|
|
|
|
%s > 0 |
22
|
|
|
|
|
|
|
) |
23
|
|
|
|
|
|
|
EOF |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
declare( |
28
|
|
|
|
|
|
|
'PositiveOrZeroNum', |
29
|
|
|
|
|
|
|
parent => t('Num'), |
30
|
|
|
|
|
|
|
inline => sub { |
31
|
|
|
|
|
|
|
return |
32
|
|
|
|
|
|
|
sprintf( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] ); |
33
|
|
|
|
|
|
|
( |
34
|
|
|
|
|
|
|
%s |
35
|
|
|
|
|
|
|
&& |
36
|
|
|
|
|
|
|
%s >= 0 |
37
|
|
|
|
|
|
|
) |
38
|
|
|
|
|
|
|
EOF |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
declare( |
43
|
|
|
|
|
|
|
'PositiveInt', |
44
|
|
|
|
|
|
|
parent => t('Int'), |
45
|
|
|
|
|
|
|
inline => sub { |
46
|
|
|
|
|
|
|
return |
47
|
|
|
|
|
|
|
sprintf( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] ); |
48
|
|
|
|
|
|
|
( |
49
|
|
|
|
|
|
|
%s |
50
|
|
|
|
|
|
|
&& |
51
|
|
|
|
|
|
|
%s > 0 |
52
|
|
|
|
|
|
|
) |
53
|
|
|
|
|
|
|
EOF |
54
|
|
|
|
|
|
|
}, |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
declare( |
58
|
|
|
|
|
|
|
'PositiveOrZeroInt', |
59
|
|
|
|
|
|
|
parent => t('Int'), |
60
|
|
|
|
|
|
|
inline => sub { |
61
|
|
|
|
|
|
|
return |
62
|
|
|
|
|
|
|
sprintf( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] ); |
63
|
|
|
|
|
|
|
( |
64
|
|
|
|
|
|
|
%s |
65
|
|
|
|
|
|
|
&& |
66
|
|
|
|
|
|
|
%s >= 0 |
67
|
|
|
|
|
|
|
) |
68
|
|
|
|
|
|
|
EOF |
69
|
|
|
|
|
|
|
}, |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
declare( |
73
|
|
|
|
|
|
|
'NegativeNum', |
74
|
|
|
|
|
|
|
parent => t('Num'), |
75
|
|
|
|
|
|
|
inline => sub { |
76
|
|
|
|
|
|
|
return |
77
|
|
|
|
|
|
|
sprintf( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] ); |
78
|
|
|
|
|
|
|
( |
79
|
|
|
|
|
|
|
%s |
80
|
|
|
|
|
|
|
&& |
81
|
|
|
|
|
|
|
%s < 0 |
82
|
|
|
|
|
|
|
) |
83
|
|
|
|
|
|
|
EOF |
84
|
|
|
|
|
|
|
}, |
85
|
|
|
|
|
|
|
); |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
declare( |
88
|
|
|
|
|
|
|
'NegativeOrZeroNum', |
89
|
|
|
|
|
|
|
parent => t('Num'), |
90
|
|
|
|
|
|
|
inline => sub { |
91
|
|
|
|
|
|
|
return |
92
|
|
|
|
|
|
|
sprintf( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] ); |
93
|
|
|
|
|
|
|
( |
94
|
|
|
|
|
|
|
%s |
95
|
|
|
|
|
|
|
&& |
96
|
|
|
|
|
|
|
%s <= 0 |
97
|
|
|
|
|
|
|
) |
98
|
|
|
|
|
|
|
EOF |
99
|
|
|
|
|
|
|
}, |
100
|
|
|
|
|
|
|
); |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
declare( |
103
|
|
|
|
|
|
|
'NegativeInt', |
104
|
|
|
|
|
|
|
parent => t('Int'), |
105
|
|
|
|
|
|
|
inline => sub { |
106
|
|
|
|
|
|
|
return |
107
|
|
|
|
|
|
|
sprintf( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] ); |
108
|
|
|
|
|
|
|
( |
109
|
|
|
|
|
|
|
%s |
110
|
|
|
|
|
|
|
&& |
111
|
|
|
|
|
|
|
%s < 0 |
112
|
|
|
|
|
|
|
) |
113
|
|
|
|
|
|
|
EOF |
114
|
|
|
|
|
|
|
}, |
115
|
|
|
|
|
|
|
); |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
declare( |
118
|
|
|
|
|
|
|
'NegativeOrZeroInt', |
119
|
|
|
|
|
|
|
parent => t('Int'), |
120
|
|
|
|
|
|
|
inline => sub { |
121
|
|
|
|
|
|
|
return |
122
|
|
|
|
|
|
|
sprintf( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] ); |
123
|
|
|
|
|
|
|
( |
124
|
|
|
|
|
|
|
%s |
125
|
|
|
|
|
|
|
&& |
126
|
|
|
|
|
|
|
%s <= 0 |
127
|
|
|
|
|
|
|
) |
128
|
|
|
|
|
|
|
EOF |
129
|
|
|
|
|
|
|
}, |
130
|
|
|
|
|
|
|
); |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
declare( |
133
|
|
|
|
|
|
|
'SingleDigit', |
134
|
|
|
|
|
|
|
parent => t('Int'), |
135
|
|
|
|
|
|
|
inline => sub { |
136
|
|
|
|
|
|
|
return |
137
|
|
|
|
|
|
|
sprintf( |
138
|
|
|
|
|
|
|
<<'EOF', $_[0]->parent->inline_check( $_[1] ), ( $_[1] ) x 2 ); |
139
|
|
|
|
|
|
|
( |
140
|
|
|
|
|
|
|
%s |
141
|
|
|
|
|
|
|
&& |
142
|
|
|
|
|
|
|
%s >= -9 |
143
|
|
|
|
|
|
|
&& |
144
|
|
|
|
|
|
|
%s <= 9 |
145
|
|
|
|
|
|
|
) |
146
|
|
|
|
|
|
|
EOF |
147
|
|
|
|
|
|
|
}, |
148
|
|
|
|
|
|
|
); |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
1; |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# ABSTRACT: Implements type constraint objects for some common numeric types |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=pod |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=encoding UTF-8 |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head1 NAME |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Specio::Library::Numeric - Implements type constraint objects for some common numeric types |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=head1 VERSION |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
version 0.48 |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head1 DESCRIPTION |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
This library provides some additional string numeric for common cases. |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head2 PositiveNum |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head2 PositiveOrZeroNum |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head2 PositiveInt |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=head2 PositiveOrZeroInt |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=head2 NegativeNum |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head2 NegativeOrZeroNum |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head2 NegativeInt |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head2 NegativeOrZeroInt |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=head2 SingleDigit |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
A single digit from -9 to 9. |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=head1 SUPPORT |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
Bugs may be submitted at L<https://github.com/houseabsolute/Specio/issues>. |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=head1 SOURCE |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
The source code repository for Specio can be found at L<https://github.com/houseabsolute/Specio>. |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head1 AUTHOR |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
This software is Copyright (c) 2012 - 2022 by Dave Rolsky. |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
This is free software, licensed under: |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
The full text of the license can be found in the |
212
|
|
|
|
|
|
|
F<LICENSE> file included with this distribution. |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=cut |