line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
30
|
|
|
30
|
|
15288
|
use strict; |
|
30
|
|
|
|
|
52
|
|
|
30
|
|
|
|
|
856
|
|
3
|
30
|
|
|
30
|
|
123
|
use warnings; |
|
30
|
|
|
|
|
49
|
|
|
30
|
|
|
|
|
1056
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package WWW::Shopify::Liquid::Tag::Decrement; |
6
|
30
|
|
|
30
|
|
126
|
use base 'WWW::Shopify::Liquid::Tag::Free'; |
|
30
|
|
|
|
|
90
|
|
|
30
|
|
|
|
|
4796
|
|
7
|
0
|
|
|
0
|
0
|
|
sub max_arguments { return 1; } |
8
|
0
|
|
|
0
|
0
|
|
sub min_arguments { return 1; } |
9
|
|
|
|
|
|
|
sub verify { |
10
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
11
|
|
|
|
|
|
|
die new WWW::Shopify::Liquid::Exception::Parser::Arguments($self, "Requires variable to decrement.") unless |
12
|
0
|
0
|
|
|
|
|
$self->{arguments}->[0]->isa('WWW::Shopify::Liquid::Token::Variable'); |
13
|
|
|
|
|
|
|
} |
14
|
30
|
|
|
30
|
|
167
|
use Scalar::Util qw(looks_like_number); |
|
30
|
|
|
|
|
46
|
|
|
30
|
|
|
|
|
8374
|
|
15
|
|
|
|
|
|
|
sub process { |
16
|
0
|
|
|
0
|
0
|
|
my ($self, $hash, $action, $pipeline) = @_; |
17
|
0
|
0
|
|
|
|
|
my @vars = map { $self->is_processed($_) ? $_ : $_->$action($pipeline, $hash) } @{$self->{arguments}->[0]->{core}}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $inner_hash = $hash; |
20
|
0
|
|
|
|
|
|
for (0..$#vars-1) { |
21
|
0
|
0
|
0
|
|
|
|
return $self if ref($inner_hash) && ref($inner_hash) eq "HASH" && !exists $inner_hash->{$vars[$_]} && $action eq 'optimize'; |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
22
|
0
|
0
|
0
|
|
|
|
if (looks_like_number($vars[$_]) && ref($inner_hash) && ref($inner_hash) eq "ARRAY") { |
|
|
|
0
|
|
|
|
|
23
|
0
|
0
|
|
|
|
|
$inner_hash->[$vars[$_]] = {} if !defined $inner_hash->[$vars[$_]]; |
24
|
0
|
|
|
|
|
|
$inner_hash = $inner_hash->[$vars[$_]]; |
25
|
|
|
|
|
|
|
} else { |
26
|
0
|
0
|
|
|
|
|
$inner_hash->{$vars[$_]} = {} if !exists $inner_hash->{$vars[$_]}; |
27
|
0
|
|
|
|
|
|
$inner_hash = $inner_hash->{$vars[$_]}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
0
|
0
|
|
|
|
|
if (looks_like_number($inner_hash->{$vars[-1]})) { |
31
|
0
|
|
|
|
|
|
$inner_hash->{$vars[-1]}--; |
32
|
|
|
|
|
|
|
} |
33
|
0
|
|
|
|
|
|
return ''; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |