line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Expression::Operator::Binary::Ge; |
2
|
2
|
|
|
2
|
|
923
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
48
|
|
3
|
2
|
|
|
2
|
|
9
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
4
|
2
|
|
|
2
|
|
39
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
75
|
|
5
|
2
|
|
|
2
|
|
8
|
use parent 'DTL::Fast::Expression::Operator::Binary'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$DTL::Fast::OPS_HANDLERS{'>='} = __PACKAGE__; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
154
|
use Scalar::Util qw(looks_like_number); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
106
|
|
10
|
2
|
|
|
2
|
|
11
|
use locale; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
13
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub dispatch |
13
|
|
|
|
|
|
|
{ |
14
|
36
|
|
|
36
|
0
|
77
|
my ( $self, $arg1, $arg2, $context) = @_; |
15
|
36
|
|
|
|
|
75
|
my ($arg1_type, $arg2_type) = (ref $arg1, ref $arg2); |
16
|
36
|
|
|
|
|
67
|
my $result = 0; |
17
|
|
|
|
|
|
|
|
18
|
36
|
100
|
100
|
|
|
287
|
if (looks_like_number($arg1) and looks_like_number($arg2)) |
|
|
50
|
33
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
50
|
|
|
|
|
|
19
|
|
|
|
|
|
|
{ |
20
|
24
|
|
|
|
|
49
|
$result = ($arg1 >= $arg2); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
elsif ($arg1_type eq 'ARRAY' and $arg2_type eq 'ARRAY') # @todo check that $arg1 includes $arg2 |
23
|
|
|
|
|
|
|
{ |
24
|
0
|
|
|
|
|
0
|
$result = ( scalar @$arg1 >= scalar @$arg2 ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
elsif ($arg1_type eq 'HASH' and $arg2_type eq 'HASH') # @todo check that $arg1 includes $arg2 |
27
|
|
|
|
|
|
|
{ |
28
|
0
|
|
|
|
|
0
|
my @keys1 = sort keys %$arg1; |
29
|
0
|
|
|
|
|
0
|
my @keys2 = sort keys %$arg2; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
0
|
$result = ( scalar @$arg1 >= scalar @$arg2 ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
elsif (UNIVERSAL::can($arg1, 'compare')) |
34
|
|
|
|
|
|
|
{ |
35
|
0
|
|
|
|
|
0
|
$result = ( $arg1->compare($arg2) > - 1 ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
elsif ( |
38
|
|
|
|
|
|
|
defined $arg1 |
39
|
|
|
|
|
|
|
and defined $arg2 |
40
|
|
|
|
|
|
|
) |
41
|
|
|
|
|
|
|
{ |
42
|
12
|
|
|
|
|
35
|
$result = ($arg1 ge $arg2); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
else |
45
|
|
|
|
|
|
|
{ |
46
|
0
|
|
0
|
|
|
0
|
die $self->get_render_error( |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
47
|
|
|
|
|
|
|
$context, |
48
|
|
|
|
|
|
|
sprintf("don't know how to compare %s (%s) to %s (%s)" |
49
|
|
|
|
|
|
|
, $arg1 // 'undef' |
50
|
|
|
|
|
|
|
, $arg1_type || 'SCALAR' |
51
|
|
|
|
|
|
|
, $arg2 // 'undef' |
52
|
|
|
|
|
|
|
, $arg2_type || 'SCALAR' |
53
|
|
|
|
|
|
|
) |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
36
|
|
|
|
|
110
|
return $result; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |