line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
21
|
|
|
21
|
|
111
|
use strict; |
|
21
|
|
|
|
|
35
|
|
|
21
|
|
|
|
|
924
|
|
4
|
21
|
|
|
21
|
|
119
|
use warnings; |
|
21
|
|
|
|
|
37
|
|
|
21
|
|
|
|
|
677
|
|
5
|
|
|
|
|
|
|
|
6
|
21
|
|
|
21
|
|
105
|
use WWW::Shopify::Liquid; |
|
21
|
|
|
|
|
37
|
|
|
21
|
|
|
|
|
1347
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# Designed to wrap objects in the hash taht shoudln't be cloned. Only works for top level. |
9
|
|
|
|
|
|
|
package WWW::Shopify::Liquid::Renderer::NoClone; |
10
|
0
|
|
|
0
|
|
0
|
sub new { return bless { inner => $_[0] }; } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package WWW::Shopify::Liquid::Renderer; |
13
|
21
|
|
|
21
|
|
101
|
use base 'WWW::Shopify::Liquid::Pipeline'; |
|
21
|
|
|
|
|
32
|
|
|
21
|
|
|
|
|
6566
|
|
14
|
|
|
|
|
|
|
|
15
|
23
|
|
|
23
|
0
|
184
|
sub new { return bless { }, $_[0]; } |
16
|
|
|
|
|
|
|
|
17
|
21
|
|
|
21
|
|
127
|
use Clone qw(clone); |
|
21
|
|
|
|
|
40
|
|
|
21
|
|
|
|
|
3325
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub render { |
20
|
7
|
|
|
7
|
0
|
10
|
my ($self, $hash, $ast) = @_; |
21
|
7
|
0
|
33
|
|
|
31
|
return '' if !$ast && !wantarray; |
22
|
7
|
50
|
33
|
|
|
31
|
my $hash_clone = $hash->{_clone} && $hash->{_clone} == 0 ? clone($hash) : $hash; |
23
|
7
|
50
|
|
|
|
18
|
return ('', $hash_clone) unless $ast; |
24
|
7
|
50
|
|
|
|
69
|
my $result = $ast->isa('WWW::Shopify::Liquid::Element') ? $ast->render($hash_clone) : "$ast"; |
25
|
7
|
50
|
|
|
|
130
|
return $result unless wantarray; |
26
|
0
|
|
|
|
|
|
return ($result, $hash_clone); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |