line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
26
|
|
|
26
|
|
134
|
use strict; |
|
26
|
|
|
|
|
45
|
|
|
26
|
|
|
|
|
865
|
|
2
|
26
|
|
|
26
|
|
142
|
use warnings; |
|
26
|
|
|
|
|
48
|
|
|
26
|
|
|
|
|
872
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: a tolerance "m > n" |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package |
6
|
|
|
|
|
|
|
Number::Tolerant::Type::more_than; |
7
|
26
|
|
|
26
|
|
125
|
use parent qw(Number::Tolerant::Type); |
|
26
|
|
|
|
|
41
|
|
|
26
|
|
|
|
|
148
|
|
8
|
|
|
|
|
|
|
|
9
|
14
|
|
|
14
|
1
|
20
|
sub construct { shift; { value => $_[0], min => $_[0], exclude_min => 1 } } |
|
14
|
|
|
|
|
69
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub parse { |
12
|
17
|
|
|
17
|
1
|
37
|
my ($self, $string, $factory) = @_; |
13
|
|
|
|
|
|
|
|
14
|
17
|
|
|
|
|
78
|
my $number = $self->number_re; |
15
|
17
|
|
|
|
|
79
|
my $X = $self->variable_re; |
16
|
|
|
|
|
|
|
|
17
|
17
|
100
|
|
|
|
393
|
return $factory->new(more_than => "$1") if $string =~ m!\A($number)\s*<$X\z!; |
18
|
16
|
100
|
|
|
|
339
|
return $factory->new(more_than => "$1") if $string =~ m!\A$X?>\s*($number)\z!; |
19
|
|
|
|
|
|
|
|
20
|
13
|
100
|
|
|
|
222
|
return $factory->new(more_than => "$1") |
21
|
|
|
|
|
|
|
if $string =~ m!\Amore\s+than\s+($number)\z!; |
22
|
12
|
|
|
|
|
62
|
return; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub valid_args { |
26
|
62
|
|
|
62
|
1
|
94
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
62
|
100
|
|
|
|
109
|
return unless 2 == grep { defined } @_; |
|
147
|
|
|
|
|
494
|
|
29
|
|
|
|
|
|
|
|
30
|
20
|
|
|
|
|
53
|
for my $i ( [0,1], [1,0] ) { |
31
|
32
|
100
|
66
|
|
|
162
|
if ( |
32
|
|
|
|
|
|
|
$_[ $i->[0] ] eq 'more_than' |
33
|
|
|
|
|
|
|
and defined (my $num = $self->normalize_number($_[ $i->[1] ])) |
34
|
|
|
|
|
|
|
) { |
35
|
14
|
|
|
|
|
70
|
return $num; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
6
|
|
|
|
|
31
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |