| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
25
|
|
|
25
|
|
239
|
use strict; |
|
|
25
|
|
|
|
|
133
|
|
|
|
25
|
|
|
|
|
1134
|
|
|
2
|
25
|
|
|
25
|
|
145
|
use warnings; |
|
|
25
|
|
|
|
|
79
|
|
|
|
25
|
|
|
|
|
1691
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: a tolerance "m < n" |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package |
|
6
|
|
|
|
|
|
|
Number::Tolerant::Type::less_than; |
|
7
|
25
|
|
|
25
|
|
148
|
use parent qw(Number::Tolerant::Type); |
|
|
25
|
|
|
|
|
49
|
|
|
|
25
|
|
|
|
|
212
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
9
|
|
|
9
|
1
|
18
|
sub construct { shift; { value => $_[0], max => $_[0], exclude_max => 1 } } |
|
|
9
|
|
|
|
|
52
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub parse { |
|
12
|
19
|
|
|
19
|
1
|
133
|
my ($self, $string, $factory) = @_; |
|
13
|
|
|
|
|
|
|
|
|
14
|
19
|
|
|
|
|
121
|
my $number = $self->number_re; |
|
15
|
19
|
|
|
|
|
97
|
my $X = $self->variable_re; |
|
16
|
19
|
100
|
|
|
|
1350
|
return $factory->new(less_than => "$1") if $string =~ m!\A$X?<\s*($number)\z!; |
|
17
|
18
|
100
|
|
|
|
1148
|
return $factory->new(less_than => "$1") if $string =~ m!\A($number)\s*>$X\z!; |
|
18
|
|
|
|
|
|
|
|
|
19
|
17
|
100
|
|
|
|
970
|
return $factory->new(less_than => "$1") |
|
20
|
|
|
|
|
|
|
if $string =~ m!\Aless\s+than\s+($number)\z!; |
|
21
|
|
|
|
|
|
|
|
|
22
|
16
|
|
|
|
|
86
|
return; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub valid_args { |
|
26
|
103
|
|
|
103
|
1
|
254
|
my $self = shift; |
|
27
|
|
|
|
|
|
|
|
|
28
|
103
|
100
|
|
|
|
222
|
return unless 2 == grep { defined } @_; |
|
|
237
|
|
|
|
|
693
|
|
|
29
|
|
|
|
|
|
|
|
|
30
|
53
|
|
|
|
|
181
|
for my $i ( [0,1], [1,0] ) { |
|
31
|
102
|
100
|
66
|
|
|
398
|
if ( |
|
32
|
|
|
|
|
|
|
$_[ $i->[0] ] eq 'less_than' |
|
33
|
|
|
|
|
|
|
and defined (my $num = $self->normalize_number($_[ $i->[1] ])) |
|
34
|
|
|
|
|
|
|
) { |
|
35
|
9
|
|
|
|
|
49
|
return $num; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
44
|
|
|
|
|
210
|
return; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |