line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Variable::Strongly::Typed::Validators; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
50
|
use version; $VERSION = qv('1.0.0'); |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
41
|
|
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
516
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
178
|
|
6
|
7
|
|
|
7
|
|
35
|
use strict; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
277
|
|
7
|
7
|
|
|
7
|
|
32
|
use Carp; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
963
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our %conditions; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# Basic variable types |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
$conditions{int} = '/\A \d+ \z/xms'; |
15
|
|
|
|
|
|
|
$conditions{string} = '!ref'; |
16
|
|
|
|
|
|
|
$conditions{float} = '/( [-+]? (?:\d+\.?\d*|\.\d+) (?:[eE]\d+)? )/xms'; |
17
|
|
|
|
|
|
|
$conditions{bool} = $conditions{int}; # 0 already accounted for |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__END__ |