line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
26
|
|
|
26
|
|
151
|
use strict; |
|
26
|
|
|
|
|
46
|
|
|
26
|
|
|
|
|
736
|
|
2
|
26
|
|
|
26
|
|
111
|
use warnings; |
|
26
|
|
|
|
|
49
|
|
|
26
|
|
|
|
|
782
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: a tolerance "m > n" |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package |
6
|
|
|
|
|
|
|
Number::Tolerant::Type::more_than; |
7
|
26
|
|
|
26
|
|
132
|
use parent qw(Number::Tolerant::Type); |
|
26
|
|
|
|
|
50
|
|
|
26
|
|
|
|
|
121
|
|
8
|
|
|
|
|
|
|
|
9
|
14
|
|
|
14
|
1
|
17
|
sub construct { shift; { value => $_[0], min => $_[0], exclude_min => 1 } } |
|
14
|
|
|
|
|
48
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub parse { |
12
|
23
|
|
|
23
|
1
|
49
|
my ($self, $string, $factory) = @_; |
13
|
|
|
|
|
|
|
|
14
|
23
|
|
|
|
|
91
|
my $number = $self->number_re; |
15
|
23
|
|
|
|
|
67
|
my $X = $self->variable_re; |
16
|
|
|
|
|
|
|
|
17
|
23
|
100
|
|
|
|
436
|
return $factory->new(more_than => "$1") if $string =~ m!\A($number)\s*<$X\z!; |
18
|
22
|
100
|
|
|
|
367
|
return $factory->new(more_than => "$1") if $string =~ m!\A$X?>\s*($number)\z!; |
19
|
|
|
|
|
|
|
|
20
|
19
|
100
|
|
|
|
261
|
return $factory->new(more_than => "$1") |
21
|
|
|
|
|
|
|
if $string =~ m!\Amore\s+than\s+($number)\z!; |
22
|
18
|
|
|
|
|
71
|
return; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub valid_args { |
26
|
105
|
|
|
105
|
1
|
155
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
105
|
100
|
|
|
|
169
|
return unless 2 == grep { defined } @_; |
|
242
|
|
|
|
|
524
|
|
29
|
|
|
|
|
|
|
|
30
|
52
|
|
|
|
|
129
|
for my $i ( [0,1], [1,0] ) { |
31
|
96
|
100
|
66
|
|
|
291
|
if ( |
32
|
|
|
|
|
|
|
$_[ $i->[0] ] eq 'more_than' |
33
|
|
|
|
|
|
|
and defined (my $num = $self->normalize_number($_[ $i->[1] ])) |
34
|
|
|
|
|
|
|
) { |
35
|
14
|
|
|
|
|
53
|
return $num; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
38
|
|
|
|
|
120
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |