line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
37
|
|
|
37
|
|
15324
|
use strict; |
|
37
|
|
|
|
|
101
|
|
|
37
|
|
|
|
|
1229
|
|
3
|
37
|
|
|
37
|
|
236
|
use warnings; |
|
37
|
|
|
|
|
88
|
|
|
37
|
|
|
|
|
1529
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package WWW::Shopify::Liquid::Operator::Equals; |
6
|
37
|
|
|
37
|
|
241
|
use base 'WWW::Shopify::Liquid::Operator'; |
|
37
|
|
|
|
|
90
|
|
|
37
|
|
|
|
|
3717
|
|
7
|
37
|
|
|
37
|
|
267
|
use Scalar::Util qw(looks_like_number); |
|
37
|
|
|
|
|
103
|
|
|
37
|
|
|
|
|
3236
|
|
8
|
1318
|
|
|
1318
|
0
|
4223
|
sub symbol { return ('==', 'is'); } |
9
|
510
|
|
|
510
|
0
|
1061
|
sub priority { return 5; } |
10
|
37
|
|
|
37
|
|
12475
|
use Data::Compare; |
|
37
|
|
|
|
|
415439
|
|
|
37
|
|
|
|
|
330
|
|
11
|
|
|
|
|
|
|
sub operate { |
12
|
588
|
|
|
588
|
0
|
2046
|
my ($self, $hash, $action, $op1, $op2) = @_; |
13
|
588
|
100
|
100
|
|
|
1688
|
return 1 if !defined $op1 && !defined $op2; |
14
|
587
|
100
|
75
|
|
|
3873
|
return 0 if defined $op1 xor defined $op2; |
15
|
343
|
50
|
66
|
|
|
1380
|
return $op1 == $op2 if (ref($op1) && ref($op2) && ref($op1) eq "DateTime" && ref($op2) eq "DateTime"); |
|
|
|
66
|
|
|
|
|
|
|
|
33
|
|
|
|
|
16
|
342
|
50
|
33
|
|
|
957
|
return Compare($op1, $op2) if (ref($op1) && ref($op2)); |
17
|
342
|
100
|
100
|
|
|
1876
|
return $op1 == $op2 if looks_like_number($op1) && looks_like_number($op2); |
18
|
273
|
|
|
|
|
1631
|
return ($op1 cmp $op2) == 0; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |