line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
26
|
|
|
26
|
|
130
|
use strict; |
|
26
|
|
|
|
|
47
|
|
|
26
|
|
|
|
|
653
|
|
2
|
26
|
|
|
26
|
|
100
|
use warnings; |
|
26
|
|
|
|
|
43
|
|
|
26
|
|
|
|
|
806
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: a tolerance "m > n" |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package |
6
|
|
|
|
|
|
|
Number::Tolerant::Type::more_than; |
7
|
26
|
|
|
26
|
|
105
|
use parent qw(Number::Tolerant::Type); |
|
26
|
|
|
|
|
42
|
|
|
26
|
|
|
|
|
102
|
|
8
|
|
|
|
|
|
|
|
9
|
14
|
|
|
14
|
1
|
17
|
sub construct { shift; { value => $_[0], min => $_[0], exclude_min => 1 } } |
|
14
|
|
|
|
|
42
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub parse { |
12
|
17
|
|
|
17
|
1
|
34
|
my ($self, $string, $factory) = @_; |
13
|
|
|
|
|
|
|
|
14
|
17
|
|
|
|
|
426
|
my $number = $self->number_re; |
15
|
17
|
|
|
|
|
43
|
my $X = $self->variable_re; |
16
|
|
|
|
|
|
|
|
17
|
17
|
100
|
|
|
|
253
|
return $factory->new(more_than => "$1") if $string =~ m!\A($number)\s*<$X\z!; |
18
|
16
|
100
|
|
|
|
215
|
return $factory->new(more_than => "$1") if $string =~ m!\A$X?>\s*($number)\z!; |
19
|
|
|
|
|
|
|
|
20
|
13
|
100
|
|
|
|
136
|
return $factory->new(more_than => "$1") |
21
|
|
|
|
|
|
|
if $string =~ m!\Amore\s+than\s+($number)\z!; |
22
|
12
|
|
|
|
|
38
|
return; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub valid_args { |
26
|
55
|
|
|
55
|
1
|
77
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
55
|
100
|
|
|
|
76
|
return unless 2 == grep { defined } @_; |
|
128
|
|
|
|
|
297
|
|
29
|
|
|
|
|
|
|
|
30
|
21
|
|
|
|
|
122
|
for my $i ( [0,1], [1,0] ) { |
31
|
34
|
100
|
66
|
|
|
107
|
if ( |
32
|
|
|
|
|
|
|
$_[ $i->[0] ] eq 'more_than' |
33
|
|
|
|
|
|
|
and defined (my $num = $self->normalize_number($_[ $i->[1] ])) |
34
|
|
|
|
|
|
|
) { |
35
|
14
|
|
|
|
|
49
|
return $num; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
7
|
|
|
|
|
17
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |