blib/lib/WWW/Shopify/Liquid/Lexer.pm

filter: Statementstmt 17.7% 76 / 429 Branchbran 0.0% 0 / 256 Conditioncond 0.0% 0 / 309 MC/DCmcdc 0.0% 0 / 160 Subroutinesub 35.7% 25 / 70 Podpod 0.0% 0 / 16 totaltotal 8.1% 101 / 1240 CC 236 SCAR 75.1
CC
236
Cov
8%
parse_text
4160.0
parse_expression
2862.0
parse_token
2550.0
CRAP 1826.8
↑ Summary blib/lib/WWW/Shopify/Liquid/Tag/Assign.pm »
1 #!/usr/bin/perl
2  
3 24 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 24 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 package WWW::Shopify::Liquid::Token;
7 24 ▶use base 'WWW::Shopify::Liquid::Element';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 0 ▶sub new { return bless { line => $_[1], core => $_[2] }, $_[0]; };
Subroutine new: not called CC=1 SCAR=6.9
9 0 ▶sub stringify { return $_[0]->{core}; }
Subroutine stringify: not called CC=1 SCAR=6.9
10 0 ▶sub tokens { return $_[0]; }
Subroutine tokens: not called CC=1 SCAR=6.9
11  
12 package WWW::Shopify::Liquid::Token::Operator;
13 24 ▶use base 'WWW::Shopify::Liquid::Token';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 package WWW::Shopify::Liquid::Token::Operand;
16 24 ▶use base 'WWW::Shopify::Liquid::Token';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 package WWW::Shopify::Liquid::Token::String;
19 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
20 0 ▶sub process { my ($self, $hash) = @_; return $self->{core}; }
Subroutine process: not called CC=1 SCAR=6.9
21  
22 package WWW::Shopify::Liquid::Token::Number;
23 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
24 0 ▶sub process { my ($self, $hash) = @_; return $self->{core}; }
Subroutine process: not called CC=1 SCAR=6.9
25  
26 package WWW::Shopify::Liquid::Token::NULL;
27 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
28 0 ▶sub process { return undef; }
Subroutine process: not called CC=1 SCAR=6.9
29  
30 package WWW::Shopify::Liquid::Token::Bool;
31 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
32 0 ▶sub process { my ($self, $hash) = @_; return $self->{core}; }
Subroutine process: not called CC=1 SCAR=6.9
33  
34 package WWW::Shopify::Liquid::Token::Variable;
35 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 24 ▶use Scalar::Util qw(looks_like_number reftype blessed);
Subroutine BEGIN: called CC=1 SCAR=0.0
38  
39 0 ▶sub new { my $package = shift; return bless { line => shift, core => [@_] }, $package; };
Subroutine new: not called CC=1 SCAR=6.9
40 sub process {
41 0 ▶ my ($self, $hash, $action, $pipeline) = @_;
Subroutine process: not called CC=20 SCAR=60.4
42 0 my $place = $hash;
43
44 0 my @inner = @{$self->{core}};
45 0 my $unprocessed = 0;
46 0 foreach my $part_idx (0..$#inner) {
47 0 my $part = $inner[$part_idx];
48 0 ▶ if (ref($part) eq 'WWW::Shopify::Liquid::Token::Variable::Processing') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $part eq 'WWW::Shopify::Liquid::Token::Variable::Processing') { } 0 0 0
49 0 $place = $part->$action($pipeline, $hash, $place);
50 }
51 else {
52 0 ▶ my $key = $self->is_processed($part) ? $part : $part->$action($pipeline, $hash);
Branch: 1 branch
BranchTrueFalseTotal
$self->is_processed($part) ? : 0 0 0
53
54 0 ▶ return $self unless defined $key && $key ne '';
Branch: 1 branch
BranchTrueFalseTotal
unless defined $key and $key ne "" 0 0 0
Condition0%0/3
defined $key and $key ne ""
!ll&&!rl&&r
000
MC/DC0%0/2
defined $key and $key ne ""
defined $key $key ne ""
Truth table0%0/3
A and B
A= defined $keyB= $key ne ""
ABresult
0X0
100
111
55 0 ▶ $self->{core}->[$part_idx] = $key if $self->is_processed($key) && $action eq "optimize";
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_processed($key) and $action eq "optimize" 0 0 0
Condition0%0/3
$self->is_processed($key) and $action eq "optimize"
!ll&&!rl&&r
000
MC/DC0%0/2
$self->is_processed($key) and $action eq "optimize"
$self->is_processed($key) $action eq "optimize"
Truth table0%0/3
A and B
A= $self->is_processed($key)B= $action eq "optimize"
ABresult
0X0
100
111
56 0 ▶ if (defined $place) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $place) 0 0 0
57 0 ▶ if (reftype($place) && reftype($place) eq "HASH" && exists $place->{$key}) {
Branch: 3 branches
BranchTrueFalseTotal
if (builtin::reftype($place) and builtin::reftype($place) eq 'HASH' and exists $place->{$key}) { } 0 0 0
elsif (builtin::reftype($place) and builtin::reftype($place) eq 'ARRAY' and &looks_like_number($key) and defined $place->[$key]) { } 0 0 0
elsif ($pipeline->make_method_calls and builtin::blessed($place) and $place->can($key)) { } 0 0 0
Condition0%0/6
builtin::reftype($place) and builtin::reftype($place) eq "HASH" and exists $place->{$key}
!ll&&!rl&&r
000
builtin::reftype($place) and builtin::reftype($place) eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/3
builtin::reftype($place) and builtin::reftype($place) eq "HASH" and exists $place->{$key}
builtin::reftype($place) builtin::reftype($place) eq "HASH" exists $place->{$key}
Truth table0%0/4
A and B and C
A= builtin::reftype($place)B= builtin::reftype($place) eq "HASH"C= exists $place->{$key}
ABCresult
0XX0
10X0
1100
1111
58 0 $place = $place->{$key};
59 ▶ } elsif (reftype($place) && reftype($place) eq "ARRAY" && looks_like_number($key) && defined $place->[$key]) {
Condition0%0/9
builtin::reftype($place) and builtin::reftype($place) eq "ARRAY" and &looks_like_number($key) and defined $place->[$key]
!ll&&!rl&&r
000
builtin::reftype($place) and builtin::reftype($place) eq "ARRAY" and &looks_like_number($key)
!ll&&!rl&&r
000
builtin::reftype($place) and builtin::reftype($place) eq "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/4
builtin::reftype($place) and builtin::reftype($place) eq "ARRAY" and &looks_like_number($key) and defined $place->[$key]
builtin::reftype($place) builtin::reftype($place) eq "ARRAY" &looks_like_number($key) defined $place->[$key]
Truth table0%0/5
A and B and C and D
A= builtin::reftype($place)B= builtin::reftype($place) eq "ARRAY"C= &looks_like_number($key)D= defined $place->[$key]
ABCDresult
0XXX0
10XX0
110X0
11100
11111
60 0 $place = $place->[$key];
61 ▶ } elsif ($pipeline->make_method_calls && blessed($place) && $place->can($key)) {
Condition0%0/6
$pipeline->make_method_calls and builtin::blessed($place) and $place->can($key)
!ll&&!rl&&r
000
$pipeline->make_method_calls and builtin::blessed($place)
!ll&&!rl&&r
000
MC/DC0%0/3
$pipeline->make_method_calls and builtin::blessed($place) and $place->can($key)
$pipeline->make_method_calls builtin::blessed($place) $place->can($key)
Truth table0%0/4
A and B and C
A= $pipeline->make_method_callsB= builtin::blessed($place)C= $place->can($key)
ABCresult
0XX0
10X0
1100
1111
62 0 $place = $place->$key;
63 } else {
64 0 $unprocessed = 1;
65 0 $place = undef;
66 }
67 }
68
69 }
70 }
71 0 ▶ return $unprocessed ? $self : $place;
Branch: 1 branch
BranchTrueFalseTotal
$unprocessed ? : 0 0 0
72 }
73 0 ▶sub stringify { return join(".", map { $_->stringify } @{$_[0]->{core}}); }
Subroutine stringify: not called CC=1 SCAR=6.9
74  
75 sub set {
76 0 ▶ my ($self, $pipeline, $hash, $value) = @_;
Subroutine set: not called CC=2 SCAR=17.9
77 0 ▶ my @vars = map { $self->is_processed($_) ? $_ : $_->render($pipeline, $hash) } @{$self->{core}};
Branch: 1 branch
BranchTrueFalseTotal
$self->is_processed($_) ? : 0 0 0
78 0 my ($reference) = $pipeline->variable_reference($hash, \@vars);
79 0 $$reference = $value;
80 0 return 1;
81 }
82  
83  
84 sub get {
85 0 ▶ my ($self, $pipeline, $hash) = @_;
Subroutine get: not called CC=3 SCAR=24.8
86 0 ▶ my @vars = map { $self->is_processed($_) ? $_ : $_->render($pipeline, $hash) } @{$self->{core}};
Branch: 1 branch
BranchTrueFalseTotal
$self->is_processed($_) ? : 0 0 0
87 0 my ($reference) = $pipeline->variable_reference($hash, \@vars, 1);
88 0 ▶ return $reference ? $$reference : undef;
Branch: 1 branch
BranchTrueFalseTotal
$reference ? : 0 0 0
89 }
90  
91 package WWW::Shopify::Liquid::Token::Variable::Processing;
92 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
93 sub process {
94 0 ▶ my ($self, $hash, $argument, $action, $pipeline) = @_;
Subroutine process: not called CC=3 SCAR=24.8
95 0 ▶ return $self if !$self->is_processed($argument);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->is_processed($argument) 0 0 0
96 0 my $result = $self->{core}->operate($hash, $argument);
97 0 ▶ return $self if !$self->is_processed($result);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->is_processed($result) 0 0 0
98 0 return $result;
99 }
100  
101 package WWW::Shopify::Liquid::Token::Variable::Named;
102 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
103  
104 0 ▶sub new { my $package = shift; return bless { line => shift, name => shift, core => shift }, $package; };
Subroutine new: not called CC=1 SCAR=6.9
105 sub process {
106 0 ▶ my ($self, $hash, $action, $pipeline) = @_;
Subroutine process: not called CC=1 SCAR=6.9
107 0 return { $self->{name} => $self->{core}->$action($pipeline, $hash) };
108 }
109  
110  
111 package WWW::Shopify::Liquid::Token::Grouping;
112 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
113 0 ▶sub new { my $package = shift; return bless { line => shift, members => [@_] }, $package; };
Subroutine new: not called CC=1 SCAR=6.9
114 0 ▶sub members { return @{$_[0]->{members}}; }
Subroutine members: not called CC=1 SCAR=6.9
115  
116 # Parentheses
117 package WWW::Shopify::Liquid::Token::Grouping::Parenthetical;
118 24 ▶use base 'WWW::Shopify::Liquid::Token::Grouping';
Subroutine BEGIN: called CC=1 SCAR=0.0
119  
120 # Like a grouping, but not really.
121 # Square brackets
122 package WWW::Shopify::Liquid::Token::Array;
123 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
124  
125 sub new {
126 0 ▶ my ($package, $line, @members) = @_;
Subroutine new: not called CC=6 SCAR=37.4
127 # Check to see whether or not the incoming member array is separated by commas.
128 # Should never begin with a comma, should never end with a comma, should always be
129 # 101010101 in terms of data and separators. If this is not the case, then we
130 # Should throw a lexing exception.
131 die new WWW::Shopify::Liquid::Exception::Lexer::InvalidSeparator($line) unless
132 0 ▶ int(grep { ($_ % 2) == 0 && $members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') } (0..$#members)) == 0 &&
Branch: 1 branch
BranchTrueFalseTotal
$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") 0 0 0
133 0 ▶ int(grep { ($_ % 2) == 1 && (!$members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') || $members[$_]->{core} ne ",") } (0..$#members)) == 0;
Branch: 2 branches
BranchTrueFalseTotal
unless int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0 and int grep({$_ % 2 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0 0 0 0
$_ % 2 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne "," 0 0 0
Condition0%0/9
int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0 and int grep({$_ % 2 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0
!ll&&!rl&&r
000
$_ % 2 == 1 && (!$members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') || $members[$_]{'core'} ne ',')
!ll&&!rl&&r
000
not $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") or $members[$_]{"core"} ne ","
l!l&&r!l&&!r
000
MC/DC0%0/2
int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0 and int grep({$_ % 2 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0
int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0 int grep({$_ % 2 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0
MC/DC0%0/3
$_ % 2 == 1 && (!$members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') || $members[$_]{'core'} ne ',')
$_ % 2 == 1 not $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") $members[$_]{"core"} ne ","
Truth table0%0/3
A and B
A= int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0B= int grep({$_ % 2 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0
ABresult
0X0
100
111
Truth table0%0/4
A && not(B) or C
A= $_ % 2 == 1B= not $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator")C= $members[$_]{"core"} ne ","
ABCresult
0XX0
1000
11X1
1011
134
135 my $self = bless {
136 line => $line,
137 0 members => [grep { !$_->isa('WWW::Shopify::Liquid::Token::Separator') } @members]
138 }, $package;
139 0 return $self;
140 };
141  
142 0 ▶sub members { return @{$_[0]->{members}}; }
Subroutine members: not called CC=1 SCAR=6.9
143 sub process {
144 0 ▶ my ($self, $hash, $action, $pipeline) = @_;
Subroutine process: not called CC=4 SCAR=30.0
145 0 my @members = $self->members;
146 0 $members[$_] = $members[$_]->$action($pipeline, $hash) for (grep { !$self->is_processed($members[$_]) } (0..$#members));
147 0 ▶ if ($action eq "optimize") {
Branch: 1 branch
BranchTrueFalseTotal
if ($action eq "optimize") 0 0 0
148 0 $self->{members}->[$_] = $_ for (grep { $self->is_processed($members[$_]) } 0..$#members);
149 }
150 0 return [@members];
151 }
152  
153 # Curly brackets
154 package WWW::Shopify::Liquid::Token::Hash;
155 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
156  
157 0 ▶sub members { return @{$_[0]->{members}}; }
Subroutine members: not called CC=1 SCAR=6.9
158 sub new {
159 0 ▶ my ($package, $line, @members) = @_;
Subroutine new: not called CC=10 SCAR=47.0
160
161 die new WWW::Shopify::Liquid::Exception::Lexer::InvalidSeparator($line) unless
162 0 ▶ int(grep { ($_ % 2) == 0 && $members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') } (0..$#members)) == 0 &&
Branch: 1 branch
BranchTrueFalseTotal
$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") 0 0 0
163 int(grep {
164 ($_ % 4) == 1 && (!$members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') || $members[$_]->{core} ne ":") ||
165 0 ▶ ($_ % 4) == 3 && (!$members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') || $members[$_]->{core} ne ",")
Branch: 1 branch
BranchTrueFalseTotal
$_ % 4 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ":" or $_ % 4 == 3 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne "," 0 0 0
Condition0%0/15
$_ % 4 == 1 && (!$members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') || $members[$_]{'core'} ne ':') || $_ % 4 == 3 && (!$members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') || $members[$_]{'core'} ne ',')
l!l&&r!l&&!r
000
$_ % 4 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ":"
!ll&&!rl&&r
000
not $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") or $members[$_]{"core"} ne ":"
l!l&&r!l&&!r
000
$_ % 4 == 3 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ","
!ll&&!rl&&r
000
not $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") or $members[$_]{"core"} ne ","
l!l&&r!l&&!r
000
MC/DC0%0/6
$_ % 4 == 1 && (!$members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') || $members[$_]{'core'} ne ':') || $_ % 4 == 3 && (!$members[$_]->isa('WWW::Shopify::Liquid::Token::Separator') || $members[$_]{'core'} ne ',')
$_ % 4 == 1 not $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") $members[$_]{"core"} ne ":" $_ % 4 == 3 not $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") $members[$_]{"core"} ne ","
Truth table0%0/10
A and not(B) or C || D and not(E) or F
A= $_ % 4 == 1B= not $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator")C= $members[$_]{"core"} ne ":"D= $_ % 4 == 3E= not $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator")F= $members[$_]{"core"} ne ","
ABCDEFresult
11XXXX1
101XXX1
0XX11X1
0XX1011
10011X1
1001011
0XX0XX0
0XX1000
1000XX0
1001000
166 } (0..$#members)) == 0 &&
167 0 ▶ int(grep { !$_->isa('WWW::Shopify::Liquid::Token::Separator') } @members) % 2 == 0;
Branch: 1 branch
BranchTrueFalseTotal
unless int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0 and int grep({$_ % 4 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ":" or $_ % 4 == 3 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0 and int(grep {not $_->isa("WWW::Shopify::Liquid::Token::Separator");} @members) % 2 == 0 0 0 0
Condition0%0/6
int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0 and int grep({$_ % 4 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ":" or $_ % 4 == 3 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0 and int(grep {not $_->isa("WWW::Shopify::Liquid::Token::Separator");} @members) % 2 == 0
!ll&&!rl&&r
000
int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0 and int grep({$_ % 4 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ":" or $_ % 4 == 3 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0
!ll&&!rl&&r
000
MC/DC0%0/3
int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0 and int grep({$_ % 4 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ":" or $_ % 4 == 3 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0 and int(grep {not $_->isa("WWW::Shopify::Liquid::Token::Separator");} @members) % 2 == 0
int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0 int grep({$_ % 4 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ":" or $_ % 4 == 3 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0 int(grep {not $_->isa("WWW::Shopify::Liquid::Token::Separator");} @members) % 2 == 0
Truth table0%0/4
A and B and C
A= int grep({$_ % 2 == 0 and $members[$_]->isa("WWW::Shopify::Liquid::Token::Separator");} 0 .. $#members) == 0B= int grep({$_ % 4 == 1 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ":" or $_ % 4 == 3 and !$members[$_]->isa("WWW::Shopify::Liquid::Token::Separator") || $members[$_]{"core"} ne ",";} 0 .. $#members) == 0C= int(grep {not $_->isa("WWW::Shopify::Liquid::Token::Separator");} @members) % 2 == 0
ABCresult
0XX0
10X0
1100
1111
168
169 return bless {
170 line => $line,
171 0 members => [grep { !$_->isa('WWW::Shopify::Liquid::Token::Separator') } @members]
172 }, $package;
173 };
174  
175 sub process {
176 0 ▶ my ($self, $hash, $action, $pipeline) = @_;
Subroutine process: not called CC=4 SCAR=30.0
177 0 my @members = $self->members;
178 0 $members[$_] = $members[$_]->$action($pipeline, $hash) for (grep { !$self->is_processed($members[$_]) } (0..$#members));
179 0 ▶ if ($action eq "optimize") {
Branch: 1 branch
BranchTrueFalseTotal
if ($action eq "optimize") 0 0 0
180 0 $self->{members}->[$_] = $_ for (grep { $self->is_processed($members[$_]) } 0..$#members);
181 }
182 0 return { @members };
183 }
184  
185  
186 package WWW::Shopify::Liquid::Token::Text;
187 24 ▶use base 'WWW::Shopify::Liquid::Token::Operand';
Subroutine BEGIN: called CC=1 SCAR=0.0
188 sub new {
189 0 ▶ my $self = { line => $_[1], core => $_[2] };
Subroutine new: not called CC=3 SCAR=24.8
190 0 my $package = $_[0];
191 0 ▶ $package = 'WWW::Shopify::Liquid::Token::Text::Whitespace' if !defined $_[2] || $_[2] =~ m/^\s*$/;
Branch: 1 branch
BranchTrueFalseTotal
if not defined $_[2] or $_[2] =~ /^\s*$/ 0 0 0
Condition0%0/3
not defined $_[2] or $_[2] =~ /^\s*$/
l!l&&r!l&&!r
000
MC/DC0%0/2
not defined $_[2] or $_[2] =~ /^\s*$/
not defined $_[2] $_[2] =~ /^\s*$/
Truth table0%0/3
not(A) or B
A= not defined $_[2]B= $_[2] =~ /^\s*$/
ABresult
1X1
011
000
192 0 return bless $self, $package;
193 };
194 0 ▶sub process { my ($self, $hash) = @_; return $self->{core}; }
Subroutine process: not called CC=1 SCAR=6.9
195  
196 package WWW::Shopify::Liquid::Token::Text::Whitespace;
197 24 ▶use base 'WWW::Shopify::Liquid::Token::Text';
Subroutine BEGIN: called CC=1 SCAR=0.0
198  
199 package WWW::Shopify::Liquid::Token::Tag;
200 24 ▶use base 'WWW::Shopify::Liquid::Token';
Subroutine BEGIN: called CC=1 SCAR=0.0
201 0 ▶sub new { return bless { line => $_[1], tag => $_[2], arguments => $_[3], strip_left => $_[4], strip_right => $_[5] }, $_[0] };
Subroutine new: not called CC=1 SCAR=6.9
202 0 ▶sub tag { return $_[0]->{tag}; }
Subroutine tag: not called CC=1 SCAR=6.9
203 0 ▶sub stringify { return $_[0]->tag; }
Subroutine stringify: not called CC=1 SCAR=6.9
204  
205 package WWW::Shopify::Liquid::Token::Output;
206 24 ▶use base 'WWW::Shopify::Liquid::Token';
Subroutine BEGIN: called CC=1 SCAR=0.0
207 0 ▶sub new { return bless { line => $_[1], core => $_[2], strip_left => $_[3], strip_right => $_[4] }, $_[0]; };
Subroutine new: not called CC=1 SCAR=6.9
208  
209 package WWW::Shopify::Liquid::Token::Separator;
210 24 ▶use base 'WWW::Shopify::Liquid::Token';
Subroutine BEGIN: called CC=1 SCAR=0.0
211  
212  
213 package WWW::Shopify::Liquid::Lexer;
214 24 ▶use base 'WWW::Shopify::Liquid::Pipeline';
Subroutine BEGIN: called CC=1 SCAR=0.0
215 24 ▶use Scalar::Util qw(looks_like_number blessed);
Subroutine BEGIN: called CC=1 SCAR=0.0
216  
217 0 ▶sub new { return bless { operators => {}, lexing_halters => {}, transparent_filters => {}, unparse_spaces => 0, parse_escaped_characters => 1 }, $_[0]; }
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
218 0 ▶sub operators { return $_[0]->{operators}; }
Subroutine operators: not called CC=1 SCAR=6.9
Pod undocumented
219 0 ▶sub unparse_spaces { $_[0]->{unparse_spaces} = $_[1] if defined $_[1]; return $_[0]->{unparse_spaces}; }
Subroutine unparse_spaces: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[1] 0 0 0
220 0 ▶sub parse_escaped_characters { $_[0]->{parse_escaped_characters} = $_[1] if defined $_[1]; return $_[0]->{parse_escaped_characters}; }
Subroutine parse_escaped_characters: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[1] 0 0 0
221 0 ▶sub register_operator { $_[0]->{operators}->{$_} = $_[1] for ($_[1]->symbol); }
Subroutine register_operator: not called CC=2 SCAR=17.9
Pod undocumented
222 sub register_tag {
223 0 ▶ my ($self, $package) = @_;
Subroutine register_tag: not called CC=3 SCAR=24.8
Pod undocumented
224 0 ▶ $self->{lexing_halters}->{$package->name} = $package if $package->is_enclosing && $package->inner_halt_lexing;
Branch: 1 branch
BranchTrueFalseTotal
if $package->is_enclosing and $package->inner_halt_lexing 0 0 0
Condition0%0/3
$package->is_enclosing and $package->inner_halt_lexing
!ll&&!rl&&r
000
MC/DC0%0/2
$package->is_enclosing and $package->inner_halt_lexing
$package->is_enclosing $package->inner_halt_lexing
Truth table0%0/3
A and B
A= $package->is_enclosingB= $package->inner_halt_lexing
ABresult
0X0
100
111
225 }
226 sub register_filter {
227 0 ▶ my ($self, $package) = @_;
Subroutine register_filter: not called CC=2 SCAR=17.9
Pod undocumented
228 0 ▶ $self->{transparent_filters}->{$package->name} = $package if ($package->transparent);
Branch: 1 branch
BranchTrueFalseTotal
if $package->transparent 0 0 0
229 }
230 0 ▶sub transparent_filters { return $_[0]->{transparent_filters}; }
Subroutine transparent_filters: not called CC=1 SCAR=6.9
Pod undocumented
231  
232 sub parse_token {
233 0 ▶ my ($self, $line, $token) = @_;
Subroutine parse_token: not called CC=50 SCAR=78.4
Pod undocumented
234
235 # Strip token of whitespace.
236 0 ▶ return undef unless defined $token;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $token 0 0 0
237 0 $token =~ s/^\s*(.*?)\s*$/$1/;
238 0 ▶ return WWW::Shopify::Liquid::Token::Operator->new($line, $token) if $self->operators->{$token};
Branch: 1 branch
BranchTrueFalseTotal
if $self->operators->{$token} 0 0 0
239 0 ▶ return WWW::Shopify::Liquid::Token::String->new($line, do {
Branch: 1 branch
BranchTrueFalseTotal
if $token =~ /^'(.*)'$/s or $token =~ /^"(.*)"$/s 0 0 0
Condition0%0/3
$token =~ /^'(.*)'$/s or $token =~ /^"(.*)"$/s
l!l&&r!l&&!r
000
MC/DC0%0/2
$token =~ /^'(.*)'$/s or $token =~ /^"(.*)"$/s
$token =~ /^'(.*)'$/s $token =~ /^"(.*)"$/s
Truth table0%0/3
A or B
A= $token =~ /^'(.*)'$/sB= $token =~ /^"(.*)"$/s
ABresult
1X1
011
000
240 0 my $string = $1;
241 0 ▶ if ($self->parse_escaped_characters) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->parse_escaped_characters) 0 0 0
242 0 $string =~ s/\\r/\r/g;
243 0 $string =~ s/\\n/\n/g;
244 0 $string =~ s/\\t/\t/g;
245 }
246 0 $string;
247 }) if $token =~ m/^'(.*)'$/s || $token =~ m/^"(.*)"$/s;
248 0 ▶ return WWW::Shopify::Liquid::Token::Number->new($line, $1) if looks_like_number($token);
Branch: 1 branch
BranchTrueFalseTotal
if &looks_like_number($token) 0 0 0
249 0 ▶ return WWW::Shopify::Liquid::Token::NULL->new() if $token eq '' || $token eq 'null';
Branch: 1 branch
BranchTrueFalseTotal
if $token eq "" or $token eq "null" 0 0 0
Condition0%0/3
$token eq "" or $token eq "null"
l!l&&r!l&&!r
000
MC/DC0%0/2
$token eq "" or $token eq "null"
$token eq "" $token eq "null"
Truth table0%0/3
A or B
A= $token eq ""B= $token eq "null"
ABresult
1X1
011
000
250 0 ▶ return WWW::Shopify::Liquid::Token::Separator->new($line, $token) if ($token eq ":" || $token eq ",");
Branch: 1 branch
BranchTrueFalseTotal
if $token eq ":" or $token eq "," 0 0 0
Condition0%0/3
$token eq ":" or $token eq ","
l!l&&r!l&&!r
000
MC/DC0%0/2
$token eq ":" or $token eq ","
$token eq ":" $token eq ","
Truth table0%0/3
A or B
A= $token eq ":"B= $token eq ","
ABresult
1X1
011
000
251 0 ▶ return WWW::Shopify::Liquid::Token::Array->new($line) if ($token eq "[]");
Branch: 1 branch
BranchTrueFalseTotal
if $token eq "[]" 0 0 0
252 0 ▶ return WWW::Shopify::Liquid::Token::Hash->new($line) if ($token eq "{}");
Branch: 1 branch
BranchTrueFalseTotal
if $token eq "{}" 0 0 0
253 # We're a variable. Let's see what's going on. Split along non quoted . and [ ] fields.
254 0 my ($squot, $dquot, $start, @parts) = (0,0,0);
255 # customer['test']['b']
256 0 my $open_square_bracket = 0;
257 0 my $open_curly_bracket = 0;
258 0 ▶ while ($token =~ m/(\.|\[|\]|\{|\}|(?<!\\)\"|(?<!\\)\'|\b$)/g) {
Branch: 1 branch
BranchTrueFalseTotal
if ($token =~ /(\.|\[|\]|\{|\}|(?<!\\)\"|(?<!\\)\'|\b$)/g) 0 0 0
259 0 my $sym = $&;
260 0 my $begin = $-[0];
261 0 my $end = $+[0];
262 0 ▶ if (!$squot && !$dquot) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($squot or $dquot) 0 0 0
Condition0%0/3
$squot or $dquot
l!l&&r!l&&!r
000
MC/DC0%0/2
$squot or $dquot
$squot $dquot
Truth table0%0/3
A or B
A= $squotB= $dquot
ABresult
1X1
011
000
263 0 ▶ $open_square_bracket-- if ($sym && $sym eq "]");
Branch: 1 branch
BranchTrueFalseTotal
if $sym and $sym eq "]" 0 0 0
Condition0%0/3
$sym and $sym eq "]"
!ll&&!rl&&r
000
MC/DC0%0/2
$sym and $sym eq "]"
$sym $sym eq "]"
Truth table0%0/3
A and B
A= $symB= $sym eq "]"
ABresult
0X0
100
111
264 0 ▶ $open_curly_bracket-- if ($sym && $sym eq "}");
Branch: 1 branch
BranchTrueFalseTotal
if $sym and $sym eq "}" 0 0 0
Condition0%0/3
$sym and $sym eq "}"
!ll&&!rl&&r
000
MC/DC0%0/2
$sym and $sym eq "}"
$sym $sym eq "}"
Truth table0%0/3
A and B
A= $symB= $sym eq "}"
ABresult
0X0
100
111
265 0 ▶ if (($sym eq "." || $sym eq "]" || $sym eq "[" || $sym eq "{" || $sym eq "}" || !$sym) && $open_square_bracket == 0 && $open_curly_bracket == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($sym eq "." || $sym eq "]" || $sym eq "[" || $sym eq "{" || $sym eq "}" || !$sym and $open_square_bracket == 0 and $open_curly_bracket == 0) 0 0 0
Condition0%0/21
$sym eq "." || $sym eq "]" || $sym eq "[" || $sym eq "{" || $sym eq "}" || !$sym and $open_square_bracket == 0 and $open_curly_bracket == 0
!ll&&!rl&&r
000
$sym eq "." || $sym eq "]" || $sym eq "[" || $sym eq "{" || $sym eq "}" || !$sym and $open_square_bracket == 0
!ll&&!rl&&r
000
$sym eq "." or $sym eq "]" or $sym eq "[" or $sym eq "{" or $sym eq "}" or not $sym
l!l&&r!l&&!r
000
$sym eq "." or $sym eq "]" or $sym eq "[" or $sym eq "{" or $sym eq "}"
l!l&&r!l&&!r
000
$sym eq "." or $sym eq "]" or $sym eq "[" or $sym eq "{"
l!l&&r!l&&!r
000
$sym eq "." or $sym eq "]" or $sym eq "["
l!l&&r!l&&!r
000
$sym eq "." or $sym eq "]"
l!l&&r!l&&!r
000
MC/DC0%0/8
$sym eq "." || $sym eq "]" || $sym eq "[" || $sym eq "{" || $sym eq "}" || !$sym and $open_square_bracket == 0 and $open_curly_bracket == 0
$sym eq "." $sym eq "]" $sym eq "[" $sym eq "{" $sym eq "}" not $sym $open_square_bracket == 0 $open_curly_bracket == 0
Truth table0%0/19
A or B or C or D or E or not(F) and G and H
A= $sym eq "."B= $sym eq "]"C= $sym eq "["D= $sym eq "{"E= $sym eq "}"F= not $symG= $open_square_bracket == 0H= $open_curly_bracket == 0
ABCDEFGHresult
000000XX0
1XXXXX0X0
01XXXX0X0
001XXX0X0
0001XX0X0
00001X0X0
0000010X0
1XXXXX100
01XXXX100
001XXX100
0001XX100
00001X100
000001100
1XXXXX111
01XXXX111
001XXX111
0001XX111
00001X111
000001111
266 0 my $contents = substr($token, $start, $begin - $start);
267
268 0 ▶ if (defined $contents && $contents !~ m/^\s*$/) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $contents and not $contents =~ /^\s*$/) 0 0 0
Condition0%0/3
defined $contents and not $contents =~ /^\s*$/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $contents and not $contents =~ /^\s*$/
defined $contents not $contents =~ /^\s*$/
Truth table0%0/3
A and not(B)
A= defined $contentsB= not $contents =~ /^\s*$/
ABresult
0X0
100
111
269 0 my @variables = ();
270 0 ▶ if (!$sym || $sym eq "." || $sym eq "[") {
Branch: 3 branches
BranchTrueFalseTotal
if (not $sym or $sym eq '.' or $sym eq '[') { } 0 0 0
elsif ($sym eq ']') { } 0 0 0
elsif ($sym eq '}') { } 0 0 0
Condition0%0/6
not $sym or $sym eq "." or $sym eq "["
l!l&&r!l&&!r
000
not $sym or $sym eq "."
l!l&&r!l&&!r
000
MC/DC0%0/3
not $sym or $sym eq "." or $sym eq "["
not $sym $sym eq "." $sym eq "["
Truth table0%0/4
not(A) or B or C
A= not $symB= $sym eq "."C= $sym eq "["
ABCresult
1XX1
01X1
0011
0000
271 0 ▶ @variables = $self->transparent_filters->{$contents} ? WWW::Shopify::Liquid::Token::Variable::Processing->new($line, $self->transparent_filters->{$contents}) : WWW::Shopify::Liquid::Token::String->new($line, $contents);
Branch: 1 branch
BranchTrueFalseTotal
$self->transparent_filters->{$contents} ? : 0 0 0
272 }
273 elsif ($sym eq "]") {
274 0 @variables = $self->parse_expression($line, $contents);
275 0 ▶ return WWW::Shopify::Liquid::Token::Array->new($line, @variables) if (int(@parts) == 0);
Branch: 1 branch
BranchTrueFalseTotal
if int @parts == 0 0 0 0
276 }
277 elsif ($sym eq "}") {
278 0 @variables = $self->parse_expression($line, $contents);
279 0 ▶ return WWW::Shopify::Liquid::Token::Hash->new($line, @variables) if (int(@parts) == 0);
Branch: 1 branch
BranchTrueFalseTotal
if int @parts == 0 0 0 0
280 }
281 0 ▶ if (int(@variables) > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (int @variables > 0) 0 0 0
282 0 ▶ if (int(@variables) == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (int @variables == 1) { } 0 0 0
283 0 push(@parts, @variables);
284 }
285 else {
286 0 push(@parts, WWW::Shopify::Liquid::Token::Grouping->new($line, @variables)) ;
287 }
288 }
289 }
290 }
291 0 ▶ $start = $end if $sym ne '"' && $sym ne "'" && !$open_curly_bracket && !$open_square_bracket;
Branch: 1 branch
BranchTrueFalseTotal
if $sym ne "\"" and $sym ne "'" and not $open_curly_bracket and not $open_square_bracket 0 0 0
Condition0%0/9
$sym ne "\"" and $sym ne "'" and not $open_curly_bracket and not $open_square_bracket
!ll&&!rl&&r
000
$sym ne "\"" and $sym ne "'" and not $open_curly_bracket
!ll&&!rl&&r
000
$sym ne "\"" and $sym ne "'"
!ll&&!rl&&r
000
MC/DC0%0/4
$sym ne "\"" and $sym ne "'" and not $open_curly_bracket and not $open_square_bracket
$sym ne "\"" $sym ne "'" not $open_curly_bracket not $open_square_bracket
Truth table0%0/5
A and B and not(C) and not(D)
A= $sym ne "\""B= $sym ne "'"C= not $open_curly_bracketD= not $open_square_bracket
ABCDresult
0XXX0
10XX0
110X0
11100
11111
292 0 ▶ $open_square_bracket++ if ($sym && $sym eq "[");
Branch: 1 branch
BranchTrueFalseTotal
if $sym and $sym eq "[" 0 0 0
Condition0%0/3
$sym and $sym eq "["
!ll&&!rl&&r
000
MC/DC0%0/2
$sym and $sym eq "["
$sym $sym eq "["
Truth table0%0/3
A and B
A= $symB= $sym eq "["
ABresult
0X0
100
111
293 0 ▶ $open_curly_bracket++ if ($sym && $sym eq "{");
Branch: 1 branch
BranchTrueFalseTotal
if $sym and $sym eq "{" 0 0 0
Condition0%0/3
$sym and $sym eq "{"
!ll&&!rl&&r
000
MC/DC0%0/2
$sym and $sym eq "{"
$sym $sym eq "{"
Truth table0%0/3
A and B
A= $symB= $sym eq "{"
ABresult
0X0
100
111
294
295 }
296 0 ▶ $squot = !$squot if $token eq "'";
Branch: 1 branch
BranchTrueFalseTotal
if $token eq "'" 0 0 0
297 0 ▶ $dquot = !$dquot if $token eq '"';
Branch: 1 branch
BranchTrueFalseTotal
if $token eq "\"" 0 0 0
298 }
299 0 return WWW::Shopify::Liquid::Token::Variable->new($line, @parts);
300 }
301  
302 24 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
303 # Returns a single token repsending the whole a expression.
304 sub parse_expression {
305 0 ▶ my ($self, $line, $exp) = @_;
Subroutine parse_expression: not called CC=53 SCAR=79.6
Pod undocumented
306 0 ▶ return () if !defined $exp || $exp eq '';
Branch: 1 branch
BranchTrueFalseTotal
if not defined $exp or $exp eq "" 0 0 0
Condition0%0/3
not defined $exp or $exp eq ""
l!l&&r!l&&!r
000
MC/DC0%0/2
not defined $exp or $exp eq ""
not defined $exp $exp eq ""
Truth table0%0/3
not(A) or B
A= not defined $expB= $exp eq ""
ABresult
1X1
011
000
307 0 my @tokens = ();
308 0 my ($start_paren, $start_space, $level, $squot, $dquot, $start_sq, $sq_level, $start_hsh, $hsh_level) = (undef, 0, 0, 0, 0, undef, 0, undef, 0);
309 # We regex along parentheses, quotation marks (both kinds), whitespace, and non-word-operators.
310 # We sort along length, so that we make sure to get all the largest operators first, so that way if a larger operator is made from a smaller one (=, ==)
311 # There's no confusion, we always try to match the largest first.
312 0 my $non_word_operators = join("|", map { quotemeta($_) } grep { $_ =~ m/^\W+$/; } sort { length($b) <=> length($a) } keys(%{$self->operators}));
313 0 ▶ while ($exp =~ m/(?:\(|\)|\]|\[|\}|\{|(?<!\\)["”“]|(?<!\\)['‘’]|(\s+|$)|($non_word_operators|,|:))/sg) {
Branch: 1 branch
BranchTrueFalseTotal
if ($exp =~ /(?:\(|\)|\]|\[|\}|\{|(?<!\\)["\x{201d}\x{201c}]|(?<!\\)['\x{2018}\x{2019}]|(\s+|$)|($non_word_operators|,|:))/gs) 0 0 0
314 0 my ($rs, $re, $rc, $whitespace, $nword_op) = ($-[0], $+[0], $&, $1, $2);
315 # Specifically to allow variables to have a - in them, and be treated as a long literal, instead of a minus sign.
316 # This is terrible behaviour, but mimics Shopify's lexer.
317 # Only if of course the entire first half of this ISN'T a number, though. 'cause that'd be insane.
318 0 ▶ next if $nword_op && $nword_op eq "-" && $rs > 0 && substr($exp, $rs-1, 1) ne " " && substr($exp, 0, $rs) !~ m/\b\d+$/;
Branch: 1 branch
BranchTrueFalseTotal
if $nword_op and $nword_op eq "-" and $rs > 0 and substr($exp, $rs - 1, 1) ne " " and not substr($exp, 0, $rs) =~ /\b\d+$/ 0 0 0
Condition0%0/12
$nword_op and $nword_op eq "-" and $rs > 0 and substr($exp, $rs - 1, 1) ne " " and not substr($exp, 0, $rs) =~ /\b\d+$/
!ll&&!rl&&r
000
$nword_op and $nword_op eq "-" and $rs > 0 and substr($exp, $rs - 1, 1) ne " "
!ll&&!rl&&r
000
$nword_op and $nword_op eq "-" and $rs > 0
!ll&&!rl&&r
000
$nword_op and $nword_op eq "-"
!ll&&!rl&&r
000
MC/DC0%0/5
$nword_op and $nword_op eq "-" and $rs > 0 and substr($exp, $rs - 1, 1) ne " " and not substr($exp, 0, $rs) =~ /\b\d+$/
$nword_op $nword_op eq "-" $rs > 0 substr($exp, $rs - 1, 1) ne " " not substr($exp, 0, $rs) =~ /\b\d+$/
Truth table0%0/6
A and B and C and D and not(E)
A= $nword_opB= $nword_op eq "-"C= $rs > 0D= substr($exp, $rs - 1, 1) ne " "E= not substr($exp, 0, $rs) =~ /\b\d+$/
ABCDEresult
0XXXX0
10XXX0
110XX0
1110X0
111100
111111
319 0 ▶ if (!$squot && !$dquot) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($squot or $dquot) 0 0 0
Condition0%0/3
$squot or $dquot
l!l&&r!l&&!r
000
MC/DC0%0/2
$squot or $dquot
$squot $dquot
Truth table0%0/3
A or B
A= $squotB= $dquot
ABresult
1X1
011
000
320 0 ▶ $start_paren = $re if $rc eq "(" && $level++ == 0;
Branch: 1 branch
BranchTrueFalseTotal
if $rc eq "(" and $level++ == 0 0 0 0
Condition0%0/3
$rc eq "(" and $level++ == 0
!ll&&!rl&&r
000
MC/DC0%0/2
$rc eq "(" and $level++ == 0
$rc eq "(" $level++ == 0
Truth table0%0/3
A and B
A= $rc eq "("B= $level++ == 0
ABresult
0X0
100
111
321 0 ▶ $start_sq = $re if $rc eq "[" && $sq_level++ == 0;
Branch: 1 branch
BranchTrueFalseTotal
if $rc eq "[" and $sq_level++ == 0 0 0 0
Condition0%0/3
$rc eq "[" and $sq_level++ == 0
!ll&&!rl&&r
000
MC/DC0%0/2
$rc eq "[" and $sq_level++ == 0
$rc eq "[" $sq_level++ == 0
Truth table0%0/3
A and B
A= $rc eq "["B= $sq_level++ == 0
ABresult
0X0
100
111
322 0 ▶ $start_hsh = $re if $rc eq "{" && $hsh_level++ == 0;
Branch: 1 branch
BranchTrueFalseTotal
if $rc eq "{" and $hsh_level++ == 0 0 0 0
Condition0%0/3
$rc eq "{" and $hsh_level++ == 0
!ll&&!rl&&r
000
MC/DC0%0/2
$rc eq "{" and $hsh_level++ == 0
$rc eq "{" $hsh_level++ == 0
Truth table0%0/3
A and B
A= $rc eq "{"B= $hsh_level++ == 0
ABresult
0X0
100
111
323 # Deal with parentheses; always the highest level of operation, except when inside a square bracket.
324 0 ▶ if ($rc eq ")" && --$level == 0 && $sq_level == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rc eq ")" and --$level == 0 and $sq_level == 0) 0 0 0
Condition0%0/6
$rc eq ")" and --$level == 0 and $sq_level == 0
!ll&&!rl&&r
000
$rc eq ")" and --$level == 0
!ll&&!rl&&r
000
MC/DC0%0/3
$rc eq ")" and --$level == 0 and $sq_level == 0
$rc eq ")" --$level == 0 $sq_level == 0
Truth table0%0/4
A and B and C
A= $rc eq ")"B= --$level == 0C= $sq_level == 0
ABCresult
0XX0
10X0
1100
1111
325 0 $start_space = $re;
326 0 push(@tokens, WWW::Shopify::Liquid::Token::Grouping->new($line, $self->parse_expression($line, substr($exp, $start_paren, $rs - $start_paren))));
327 }
328 0 ▶ --$sq_level if $rc eq "]";
Branch: 1 branch
BranchTrueFalseTotal
if $rc eq "]" 0 0 0
329 0 ▶ --$hsh_level if $rc eq "}";
Branch: 1 branch
BranchTrueFalseTotal
if $rc eq "}" 0 0 0
330 0 ▶ if ($level == 0 && $sq_level == 0 && $hsh_level == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($level == 0 and $sq_level == 0 and $hsh_level == 0) 0 0 0
Condition0%0/6
$level == 0 and $sq_level == 0 and $hsh_level == 0
!ll&&!rl&&r
000
$level == 0 and $sq_level == 0
!ll&&!rl&&r
000
MC/DC0%0/3
$level == 0 and $sq_level == 0 and $hsh_level == 0
$level == 0 $sq_level == 0 $hsh_level == 0
Truth table0%0/4
A and B and C
A= $level == 0B= $sq_level == 0C= $hsh_level == 0
ABCresult
0XX0
10X0
1100
1111
331 # If we're only spaces, that means we're a new a token.
332 0 ▶ if (defined $whitespace || $nword_op) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $whitespace or $nword_op) 0 0 0
Condition0%0/3
defined $whitespace or $nword_op
l!l&&r!l&&!r
000
MC/DC0%0/2
defined $whitespace or $nword_op
defined $whitespace $nword_op
Truth table0%0/3
A or B
A= defined $whitespaceB= $nword_op
ABresult
1X1
011
000
333 0 ▶ if (defined $start_space) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $start_space) 0 0 0
334 0 my $contents = substr($exp, $start_space, $rs - $start_space);
335 0 ▶ push(@tokens, $self->parse_token($line, $contents)) if $contents !~ m/^\s*$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $contents =~ /^\s*$/ 0 0 0
336 }
337 0 ▶ push(@tokens, $self->parse_token($line, $nword_op)) if $nword_op;
Branch: 1 branch
BranchTrueFalseTotal
if $nword_op 0 0 0
338 0 $start_space = $re;
339 }
340 }
341 }
342 0 ▶ $squot = !$squot if ($rc eq "'" && !$dquot);
Branch: 1 branch
BranchTrueFalseTotal
if $rc eq "'" and not $dquot 0 0 0
Condition0%0/3
$rc eq "'" and not $dquot
!ll&&!rl&&r
000
MC/DC0%0/2
$rc eq "'" and not $dquot
$rc eq "'" not $dquot
Truth table0%0/3
A and not(B)
A= $rc eq "'"B= not $dquot
ABresult
0X0
100
111
343 0 ▶ $dquot = !$dquot if ($rc eq '"' && !$squot);
Branch: 1 branch
BranchTrueFalseTotal
if $rc eq "\"" and not $squot 0 0 0
Condition0%0/3
$rc eq "\"" and not $squot
!ll&&!rl&&r
000
MC/DC0%0/2
$rc eq "\"" and not $squot
$rc eq "\"" not $squot
Truth table0%0/3
A and not(B)
A= $rc eq "\""B= not $squot
ABresult
0X0
100
111
344 }
345 0 ▶ die WWW::Shopify::Liquid::Exception::Lexer::UnbalancedBrace->new($line) unless $level == 0;
Branch: 1 branch
BranchTrueFalseTotal
unless $level == 0 0 0 0
346 # Go through and combine any -1 from OP NUM to NUM.
347 my @ids = grep {
348 0 $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Number') &&
349 0 ▶ $tokens[$_-1]->isa('WWW::Shopify::Liquid::Token::Operator') && $tokens[$_-1]->{core} eq "-" &&
Branch: 1 branch
BranchTrueFalseTotal
$tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number") and $tokens[$_ - 1]->isa("WWW::Shopify::Liquid::Token::Operator") and $tokens[$_ - 1]{"core"} eq "-" and $_ == 1 || $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Separator") || $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Operator") 0 0 0
Condition0%0/15
$tokens[$_]->isa('WWW::Shopify::Liquid::Token::Number') && $tokens[$_ - 1]->isa('WWW::Shopify::Liquid::Token::Operator') && $tokens[$_ - 1]{'core'} eq '-' && ($_ == 1 || $tokens[$_ - 2]->isa('WWW::Shopify::Liquid::Token::Separator') || $tokens[$_ - 2]->isa('WWW::Shopify::Liquid::Token::Operator'))
!ll&&!rl&&r
000
$tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number") and $tokens[$_ - 1]->isa("WWW::Shopify::Liquid::Token::Operator") and $tokens[$_ - 1]{"core"} eq "-"
!ll&&!rl&&r
000
$tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number") and $tokens[$_ - 1]->isa("WWW::Shopify::Liquid::Token::Operator")
!ll&&!rl&&r
000
$_ == 1 or $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Separator") or $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Operator")
l!l&&r!l&&!r
000
$_ == 1 or $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Separator")
l!l&&r!l&&!r
000
MC/DC0%0/6
$tokens[$_]->isa('WWW::Shopify::Liquid::Token::Number') && $tokens[$_ - 1]->isa('WWW::Shopify::Liquid::Token::Operator') && $tokens[$_ - 1]{'core'} eq '-' && ($_ == 1 || $tokens[$_ - 2]->isa('WWW::Shopify::Liquid::Token::Separator') || $tokens[$_ - 2]->isa('WWW::Shopify::Liquid::Token::Operator'))
$tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number") $tokens[$_ - 1]->isa("WWW::Shopify::Liquid::Token::Operator") $tokens[$_ - 1]{"core"} eq "-" $_ == 1 $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Separator") $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Operator")
Truth table0%0/7
A and B and C && D or E or F
A= $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number")B= $tokens[$_ - 1]->isa("WWW::Shopify::Liquid::Token::Operator")C= $tokens[$_ - 1]{"core"} eq "-"D= $_ == 1E= $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Separator")F= $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Operator")
ABCDEFresult
0XXXXX0
10XXXX0
110XXX0
1110000
1111XX1
11101X1
1110011
350 ($_ == 1 || $tokens[$_-2]->isa('WWW::Shopify::Liquid::Token::Separator') || $tokens[$_-2]->isa('WWW::Shopify::Liquid::Token::Operator'))
351 } 1..$#tokens;
352 0 for (@ids) { $tokens[$_]->{core} *= -1; $tokens[$_-1] = undef; }
353 0 @tokens = grep { defined $_ } @tokens;
354 # Go through and combine colon separated arguments into named arguments.
355 @ids = grep {
356 0 ($_ == 2 || !$tokens[$_-3]->isa('WWW::Shopify::Liquid::Token::Operator') || $tokens[$_-3]->{core} ne "|") &&
357 0 ▶ $tokens[$_-2]->isa('WWW::Shopify::Liquid::Token::Variable') && int(@{$tokens[$_-2]->{core}}) == 1 && $tokens[$_-2]->{core}->[0]->isa('WWW::Shopify::Liquid::Token::String') &&
Condition0%0/9
$tokens[$_]->isa("WWW::Shopify::Liquid::Token::Grouping") or $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Variable") or $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number") or $tokens[$_]->isa("WWW::Shopify::Liquid::Token::String")
l!l&&r!l&&!r
000
$tokens[$_]->isa("WWW::Shopify::Liquid::Token::Grouping") or $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Variable") or $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number")
l!l&&r!l&&!r
000
$tokens[$_]->isa("WWW::Shopify::Liquid::Token::Grouping") or $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Variable")
l!l&&r!l&&!r
000
MC/DC0%0/4
$tokens[$_]->isa("WWW::Shopify::Liquid::Token::Grouping") or $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Variable") or $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number") or $tokens[$_]->isa("WWW::Shopify::Liquid::Token::String")
$tokens[$_]->isa("WWW::Shopify::Liquid::Token::Grouping") $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Variable") $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number") $tokens[$_]->isa("WWW::Shopify::Liquid::Token::String")
Truth table0%0/5
A or B or C or D
A= $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Grouping")B= $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Variable")C= $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number")D= $tokens[$_]->isa("WWW::Shopify::Liquid::Token::String")
ABCDresult
1XXX1
01XX1
001X1
00011
00000
358 0 ▶ $tokens[$_-1]->isa('WWW::Shopify::Liquid::Token::Separator') && $tokens[$_-1]->{core} eq ":" &&
Branch: 1 branch
BranchTrueFalseTotal
$_ == 2 || !$tokens[$_ - 3]->isa("WWW::Shopify::Liquid::Token::Operator") || $tokens[$_ - 3]{"core"} ne "|" and $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Variable") and int @{$tokens[$_ - 2]{"core"};} == 1 and $tokens[$_ - 2]{"core"}[0]->isa("WWW::Shopify::Liquid::Token::String") and $tokens[$_ - 1]->isa("WWW::Shopify::Liquid::Token::Separator") and $tokens[$_ - 1]{"core"} eq ":" and $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Grouping") || $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Variable") || $tokens[$_]->isa("WWW::Shopify::Liquid::Token::Number") || $tokens[$_]->isa("WWW::Shopify::Liquid::Token::String") 0 0 0
Condition0%0/24
($_ == 2 || !$tokens[$_ - 3]->isa('WWW::Shopify::Liquid::Token::Operator') || $tokens[$_ - 3]{'core'} ne '|') && $tokens[$_ - 2]->isa('WWW::Shopify::Liquid::Token::Variable') && int @{$tokens[$_ - 2]{'core'};} == 1 && $tokens[$_ - 2]{'core'}[0]->isa('WWW::Shopify::Liquid::Token::String') && $tokens[$_ - 1]->isa('WWW::Shopify::Liquid::Token::Separator') && $tokens[$_ - 1]{'core'} eq ':' && ($tokens[$_]->isa('WWW::Shopify::Liquid::Token::Grouping') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Variable') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Number') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::String'))
!ll&&!rl&&r
000
$_ == 2 || !$tokens[$_ - 3]->isa("WWW::Shopify::Liquid::Token::Operator") || $tokens[$_ - 3]{"core"} ne "|" and $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Variable") and int @{$tokens[$_ - 2]{"core"};} == 1 and $tokens[$_ - 2]{"core"}[0]->isa("WWW::Shopify::Liquid::Token::String") and $tokens[$_ - 1]->isa("WWW::Shopify::Liquid::Token::Separator") and $tokens[$_ - 1]{"core"} eq ":"
!ll&&!rl&&r
000
$_ == 2 || !$tokens[$_ - 3]->isa("WWW::Shopify::Liquid::Token::Operator") || $tokens[$_ - 3]{"core"} ne "|" and $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Variable") and int @{$tokens[$_ - 2]{"core"};} == 1 and $tokens[$_ - 2]{"core"}[0]->isa("WWW::Shopify::Liquid::Token::String") and $tokens[$_ - 1]->isa("WWW::Shopify::Liquid::Token::Separator")
!ll&&!rl&&r
000
$_ == 2 || !$tokens[$_ - 3]->isa("WWW::Shopify::Liquid::Token::Operator") || $tokens[$_ - 3]{"core"} ne "|" and $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Variable") and int @{$tokens[$_ - 2]{"core"};} == 1 and $tokens[$_ - 2]{"core"}[0]->isa("WWW::Shopify::Liquid::Token::String")
!ll&&!rl&&r
000
$_ == 2 || !$tokens[$_ - 3]->isa("WWW::Shopify::Liquid::Token::Operator") || $tokens[$_ - 3]{"core"} ne "|" and $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Variable") and int @{$tokens[$_ - 2]{"core"};} == 1
!ll&&!rl&&r
000
$_ == 2 || !$tokens[$_ - 3]->isa("WWW::Shopify::Liquid::Token::Operator") || $tokens[$_ - 3]{"core"} ne "|" and $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Variable")
!ll&&!rl&&r
000
$_ == 2 or not $tokens[$_ - 3]->isa("WWW::Shopify::Liquid::Token::Operator") or $tokens[$_ - 3]{"core"} ne "|"
l!l&&r!l&&!r
000
$_ == 2 or not $tokens[$_ - 3]->isa("WWW::Shopify::Liquid::Token::Operator")
l!l&&r!l&&!r
000
MC/DC0%0/9
($_ == 2 || !$tokens[$_ - 3]->isa('WWW::Shopify::Liquid::Token::Operator') || $tokens[$_ - 3]{'core'} ne '|') && $tokens[$_ - 2]->isa('WWW::Shopify::Liquid::Token::Variable') && int @{$tokens[$_ - 2]{'core'};} == 1 && $tokens[$_ - 2]{'core'}[0]->isa('WWW::Shopify::Liquid::Token::String') && $tokens[$_ - 1]->isa('WWW::Shopify::Liquid::Token::Separator') && $tokens[$_ - 1]{'core'} eq ':' && ($tokens[$_]->isa('WWW::Shopify::Liquid::Token::Grouping') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Variable') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Number') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::String'))
$_ == 2 not $tokens[$_ - 3]->isa("WWW::Shopify::Liquid::Token::Operator") $tokens[$_ - 3]{"core"} ne "|" $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Variable") int @{$tokens[$_ - 2]{"core"};} == 1 $tokens[$_ - 2]{"core"}[0]->isa("WWW::Shopify::Liquid::Token::String") $tokens[$_ - 1]->isa("WWW::Shopify::Liquid::Token::Separator") $tokens[$_ - 1]{"core"} eq ":" ($tokens[$_]->isa('WWW::Shopify::Liquid::Token::Grouping') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Variable') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Number') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::String'))
Truth table0%0/22
A or not(B) or C and D and E and F and G and H && I
A= $_ == 2B= not $tokens[$_ - 3]->isa("WWW::Shopify::Liquid::Token::Operator")C= $tokens[$_ - 3]{"core"} ne "|"D= $tokens[$_ - 2]->isa("WWW::Shopify::Liquid::Token::Variable")E= int @{$tokens[$_ - 2]{"core"};} == 1F= $tokens[$_ - 2]{"core"}[0]->isa("WWW::Shopify::Liquid::Token::String")G= $tokens[$_ - 1]->isa("WWW::Shopify::Liquid::Token::Separator")H= $tokens[$_ - 1]{"core"} eq ":"I= ($tokens[$_]->isa('WWW::Shopify::Liquid::Token::Grouping') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Variable') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Number') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::String'))
ABCDEFGHIresult
000XXXXXX0
1XX0XXXXX0
01X0XXXXX0
0010XXXXX0
1XX10XXXX0
01X10XXXX0
00110XXXX0
1XX110XXX0
01X110XXX0
001110XXX0
1XX1110XX0
01X1110XX0
0011110XX0
1XX11110X0
01X11110X0
00111110X0
1XX1111100
01X1111100
0011111100
1XX1111111
01X1111111
0011111111
359 ($tokens[$_]->isa('WWW::Shopify::Liquid::Token::Grouping') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Variable') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::Number') || $tokens[$_]->isa('WWW::Shopify::Liquid::Token::String'))
360 } (2..$#tokens);
361 0 for (@ids) { $tokens[$_] = WWW::Shopify::Liquid::Token::Variable::Named->new($line, $tokens[$_-2]->{core}->[0]->{core}, $tokens[$_]); $tokens[$_-2] = undef; $tokens[$_-1] = undef; }
362 0 @tokens = grep { defined $_ } @tokens;
363 0 return @tokens;
364 }
365  
366 sub parse_text {
367 0 ▶ my ($self, $text) = @_;
Subroutine parse_text: not called CC=64 SCAR=83.3
Pod undocumented
368 0 ▶ return () unless defined $text;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $text 0 0 0
369 0 my @tokens = ();
370 0 my $start = 0;
371 0 my $line = 1;
372 0 my $column = 0;
373 0 my $lexing_halter = undef;
374
375 0 my $start_line = 1;
376 0 my $start_column = 0;
377 0 my $line_position = 0;
378
379 0 ▶ return (WWW::Shopify::Liquid::Token::Text->new(1, '')) if $text eq '';
Branch: 1 branch
BranchTrueFalseTotal
if $text eq "" 0 0 0
380
381 # No need to worry about quotations; liquid overrides everything.
382 # We specifically look for tags within tags due to lexing halters abilities to be placed pretty much anywhere.
383 # Oh god no, we have to rewrite this so nested output braces inside strings inside output braces are parsed properly.
384 #while ($text =~ m/(?:(?:{%\s*(\w+)\s*(.*?)(?:\s*%}|\s*(?={%)))|(?:{{\s*(.*?)\s*}})|(\n)|$)/sg) {
385 0 my $open_tag = undef;
386 0 my $open_output_tag = undef;
387 0 my $open_single_quote = undef;
388 0 my $open_double_quote = undef;
389 0 my $start_tag_strip = undef;
390 0 my $end_tag_strip = undef;
391 0 my @lines = split(/\n/, $text);
392 0 ▶ while ($text =~ m/(?:(?:({%\-?)|(\-?%}))|(?:(\{\{\-?)|(\-?\}\}))|(\n)|(")|(')|$)/sg) {
Branch: 1 branch
BranchTrueFalseTotal
if ($text =~ /(?:(?:({%\-?)|(\-?%}))|(?:(\{\{\-?)|(\-?\}\}))|(\n)|(")|(')|$)/gs) 0 0 0
393 0 my ($start_tag, $end_tag, $start_output_tag, $end_output_tag, $newline, $double_quote, $single_quote) = ($1, $2, $3, $4, $5, $6, $7);
394 0 ▶ next if ($double_quote || $single_quote) && !$open_tag && !$open_output_tag;
Branch: 1 branch
BranchTrueFalseTotal
if $double_quote || $single_quote and not $open_tag and not $open_output_tag 0 0 0
Condition0%0/9
$double_quote || $single_quote and not $open_tag and not $open_output_tag
!ll&&!rl&&r
000
$double_quote || $single_quote and not $open_tag
!ll&&!rl&&r
000
$double_quote or $single_quote
l!l&&r!l&&!r
000
MC/DC0%0/4
$double_quote || $single_quote and not $open_tag and not $open_output_tag
$double_quote $single_quote not $open_tag not $open_output_tag
Truth table0%0/7
A or B and not(C) and not(D)
A= $double_quoteB= $single_quoteC= not $open_tagD= not $open_output_tag
ABCDresult
00XX0
1X0X0
010X0
1X100
01100
1X111
01111
395 0 my $column = $+[0] - $line_position;
396 0 my $position = [$start_line, $start_column, $-[0], $self->file_context];
397 0 my $end_position = [$start_line, $start_column, $+[0], $self->file_context];
398
399 0 ▶ if ($start_output_tag || $start_tag) {
Branch: 2 branches
BranchTrueFalseTotal
if ($start_output_tag or $start_tag) { } 0 0 0
elsif ($end_output_tag or $end_tag) { } 0 0 0
Condition0%0/3
$start_output_tag or $start_tag
l!l&&r!l&&!r
000
MC/DC0%0/2
$start_output_tag or $start_tag
$start_output_tag $start_tag
Truth table0%0/3
A or B
A= $start_output_tagB= $start_tag
ABresult
1X1
011
000
400 0 ▶ $start_tag_strip = index(($start_output_tag || $start_tag), "-") != -1;
Condition0%0/3
$start_output_tag || $start_tag
l!l&&r!l&&!r
000
MC/DC0%0/2
$start_output_tag || $start_tag
$start_output_tag $start_tag
Truth table0%0/3
A || B
A= $start_output_tagB= $start_tag
ABresult
1X1
011
000
401 0 $end_tag_strip = undef;
402 ▶ } elsif ($end_output_tag || $end_tag) {
Condition0%0/3
$end_output_tag or $end_tag
l!l&&r!l&&!r
000
MC/DC0%0/2
$end_output_tag or $end_tag
$end_output_tag $end_tag
Truth table0%0/3
A or B
A= $end_output_tagB= $end_tag
ABresult
1X1
011
000
403 0 ▶ $end_tag_strip = index(($end_output_tag || $end_tag), "-") != -1;
Condition0%0/3
$end_output_tag || $end_tag
l!l&&r!l&&!r
000
MC/DC0%0/2
$end_output_tag || $end_tag
$end_output_tag $end_tag
Truth table0%0/3
A || B
A= $end_output_tagB= $end_tag
ABresult
1X1
011
000
404 }
405
406 0 ▶ if (!$lexing_halter) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($lexing_halter) 0 0 0
407 0 ▶ if ($double_quote || $single_quote) {
Branch: 1 branch
BranchTrueFalseTotal
if ($double_quote or $single_quote) 0 0 0
Condition0%0/3
$double_quote or $single_quote
l!l&&r!l&&!r
000
MC/DC0%0/2
$double_quote or $single_quote
$double_quote $single_quote
Truth table0%0/3
A or B
A= $double_quoteB= $single_quote
ABresult
1X1
011
000
408 0 ▶ if (!$open_double_quote && $single_quote) {
Branch: 2 branches
BranchTrueFalseTotal
if (not $open_double_quote and $single_quote) { } 0 0 0
elsif (not $open_single_quote and $double_quote) { } 0 0 0
Condition0%0/3
not $open_double_quote and $single_quote
!ll&&!rl&&r
000
MC/DC0%0/2
not $open_double_quote and $single_quote
not $open_double_quote $single_quote
Truth table0%0/3
not(A) and B
A= not $open_double_quoteB= $single_quote
ABresult
0X0
100
111
409 0 ▶ $open_single_quote = $open_single_quote ? undef : $position;
Branch: 1 branch
BranchTrueFalseTotal
$open_single_quote ? : 0 0 0
410 ▶ } elsif (!$open_single_quote && $double_quote) {
Condition0%0/3
not $open_single_quote and $double_quote
!ll&&!rl&&r
000
MC/DC0%0/2
not $open_single_quote and $double_quote
not $open_single_quote $double_quote
Truth table0%0/3
not(A) and B
A= not $open_single_quoteB= $double_quote
ABresult
0X0
100
111
411 0 ▶ $open_double_quote = $open_double_quote ? undef : $position;
Branch: 1 branch
BranchTrueFalseTotal
$open_double_quote ? : 0 0 0
412 }
413 0 next;
414 }
415 0 ▶ next if $open_single_quote || $open_double_quote;
Branch: 1 branch
BranchTrueFalseTotal
if $open_single_quote or $open_double_quote 0 0 0
Condition0%0/3
$open_single_quote or $open_double_quote
l!l&&r!l&&!r
000
MC/DC0%0/2
$open_single_quote or $open_double_quote
$open_single_quote $open_double_quote
Truth table0%0/3
A or B
A= $open_single_quoteB= $open_double_quote
ABresult
1X1
011
000
416
417 0 ▶ die new WWW::Shopify::Liquid::Exception::Lexer::UnbalancedTag([$line, ($-[0] - $line_position), $-[0]]) if ($end_tag && !defined $open_tag);
Branch: 1 branch
BranchTrueFalseTotal
if $end_tag and not defined $open_tag 0 0 0
Condition0%0/3
$end_tag and not defined $open_tag
!ll&&!rl&&r
000
MC/DC0%0/2
$end_tag and not defined $open_tag
$end_tag not defined $open_tag
Truth table0%0/3
A and not(B)
A= $end_tagB= not defined $open_tag
ABresult
0X0
100
111
418 # Unbalanced outputs tags shouldn't throw a lexer exception, due to CSS rules. We just treat this as part of text.
419 # die new WWW::Shopify::Liquid::Exception::Lexer::UnbalancedOutputTag($position) if $end_output_tag && !defined $open_output_tag;
420 0 ▶ next if $end_output_tag && !defined $open_output_tag;
Branch: 1 branch
BranchTrueFalseTotal
if $end_output_tag and not defined $open_output_tag 0 0 0
Condition0%0/3
$end_output_tag and not defined $open_output_tag
!ll&&!rl&&r
000
MC/DC0%0/2
$end_output_tag and not defined $open_output_tag
$end_output_tag not defined $open_output_tag
Truth table0%0/3
A and not(B)
A= $end_output_tagB= not defined $open_output_tag
ABresult
0X0
100
111
421 }
422 0 ▶ if ($newline) {
Branch: 1 branch
BranchTrueFalseTotal
if ($newline) 0 0 0
423 0 ++$line;
424 0 $line_position = $+[0];
425 0 next;
426 }
427 0 ▶ if ($start_tag) {
Branch: 1 branch
BranchTrueFalseTotal
if ($start_tag) 0 0 0
428 0 $open_tag = $position;
429 0 next;
430 }
431 0 ▶ if ($start_output_tag) {
Branch: 1 branch
BranchTrueFalseTotal
if ($start_output_tag) 0 0 0
432 0 $open_output_tag = $position;
433 0 next;
434 }
435
436 0 my ($tag, $arguments, $output);
437 0 my $start_element = undef;
438 0 my $end_element = undef;
439 0 ▶ if ($end_tag && $open_tag) {
Branch: 2 branches
BranchTrueFalseTotal
if ($end_tag and $open_tag) { } 0 0 0
elsif ($end_output_tag and $open_output_tag) { } 0 0 0
Condition0%0/3
$end_tag and $open_tag
!ll&&!rl&&r
000
MC/DC0%0/2
$end_tag and $open_tag
$end_tag $open_tag
Truth table0%0/3
A and B
A= $end_tagB= $open_tag
ABresult
0X0
100
111
440 0 my $tag_line = substr($text, $open_tag->[2]+2, $-[0] - $open_tag->[2] - 2);
441 0 $start_element = $open_tag;
442 0 $end_element = $end_position;
443 0 $open_tag = undef;
444 0 ▶ die new WWW::Shopify::Liquid::Exception::Lexer::Tag($start_element, $tag_line) unless $tag_line =~ m/\s*(\w+)\s*(.*?)\s*$/s;
Branch: 1 branch
BranchTrueFalseTotal
unless $tag_line =~ /\s*(\w+)\s*(.*?)\s*$/s 0 0 0
445 0 ($tag, $arguments) = ($1, $2);
446 ▶ } elsif ($end_output_tag && $open_output_tag) {
Condition0%0/3
$end_output_tag and $open_output_tag
!ll&&!rl&&r
000
MC/DC0%0/2
$end_output_tag and $open_output_tag
$end_output_tag $open_output_tag
Truth table0%0/3
A and B
A= $end_output_tagB= $open_output_tag
ABresult
0X0
100
111
447 0 $start_element = $open_output_tag;
448 0 $end_element = $end_position;
449 0 $output = substr($text, $open_output_tag->[2]+2, $-[0] - $open_output_tag->[2] - 2);
450 0 $output =~ s/(^\s*|\s*$)//g;
451 0 $open_output_tag = undef;
452 } else {
453 0 $start_element = $position;
454 0 $end_element = $end_position;
455 }
456
457 0 ▶ if ($tag && !$lexing_halter && exists $self->{lexing_halters}->{$tag}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($tag and not $lexing_halter and exists $self->{'lexing_halters'}{$tag}) { } 0 0 0
elsif ($tag and $lexing_halter and $tag eq 'end' . $lexing_halter) { } 0 0 0
Condition0%0/6
$tag and not $lexing_halter and exists $self->{"lexing_halters"}{$tag}
!ll&&!rl&&r
000
$tag and not $lexing_halter
!ll&&!rl&&r
000
MC/DC0%0/3
$tag and not $lexing_halter and exists $self->{"lexing_halters"}{$tag}
$tag not $lexing_halter exists $self->{"lexing_halters"}{$tag}
Truth table0%0/4
A and not(B) and C
A= $tagB= not $lexing_halterC= exists $self->{"lexing_halters"}{$tag}
ABCresult
0XX0
10X0
1100
1111
458 0 $lexing_halter = $tag;
459 0 ▶ push(@tokens, WWW::Shopify::Liquid::Token::Text->new($position, substr($text, $start, $start_element->[2] - $start), $start_tag_strip, $end_tag_strip)) if ($start < $start_element->[2]);
Branch: 1 branch
BranchTrueFalseTotal
if $start < $start_element->[2] 0 0 0
460 0 push(@tokens, WWW::Shopify::Liquid::Token::Tag->new($position, $tag, [$self->parse_expression($position, $arguments)], $start_tag_strip, $end_tag_strip));
461 0 $start = $end_element->[2];
462 0 $start_line = $line;
463 0 $start_column = $start_element->[2] - $line_position;
464 0 $position = [$start_line, $start_column, $start_element->[2], $self->file_context];
465 0 $start_element = $position;
466 }
467 ▶ elsif ($tag && $lexing_halter && $tag eq "end" . $lexing_halter) {
Condition0%0/6
$tag and $lexing_halter and $tag eq 'end' . $lexing_halter
!ll&&!rl&&r
000
$tag and $lexing_halter
!ll&&!rl&&r
000
MC/DC0%0/3
$tag and $lexing_halter and $tag eq 'end' . $lexing_halter
$tag $lexing_halter $tag eq 'end' . $lexing_halter
Truth table0%0/4
A and B and C
A= $tagB= $lexing_halterC= $tag eq 'end' . $lexing_halter
ABCresult
0XX0
10X0
1100
1111
468 0 $lexing_halter = undef;
469 }
470 0 ▶ if (!$lexing_halter) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($lexing_halter) 0 0 0
471 0 ▶ if ($start < $start_element->[2]) {
Branch: 1 branch
BranchTrueFalseTotal
if ($start < $start_element->[2]) 0 0 0
472 0 push(@tokens, WWW::Shopify::Liquid::Token::Text->new([$start_line, $start_column, $start, $self->file_context], substr($text, $start, $start_element->[2] - $start), $start_tag_strip, $end_tag_strip));
473 # Strip whitespace.
474 0 ▶ if (int(@tokens) > 1 && $tokens[-1]->isa('WWW::Shopify::Liquid::Token::Text') && ($tokens[-2]->isa('WWW::Shopify::Liquid::Token::Tag') || $tokens[-2]->isa('WWW::Shopify::Liquid::Token::Output')) && $tokens[-2]->{strip_right}) {
Branch: 1 branch
BranchTrueFalseTotal
if (int @tokens > 1 and $tokens[-1]->isa("WWW::Shopify::Liquid::Token::Text") and $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Tag") || $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Output") and $tokens[-2]{"strip_right"}) 0 0 0
Condition0%0/12
int @tokens > 1 and $tokens[-1]->isa("WWW::Shopify::Liquid::Token::Text") and $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Tag") || $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Output") and $tokens[-2]{"strip_right"}
!ll&&!rl&&r
000
int @tokens > 1 and $tokens[-1]->isa("WWW::Shopify::Liquid::Token::Text") and $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Tag") || $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Output")
!ll&&!rl&&r
000
int @tokens > 1 and $tokens[-1]->isa("WWW::Shopify::Liquid::Token::Text")
!ll&&!rl&&r
000
$tokens[-2]->isa("WWW::Shopify::Liquid::Token::Tag") or $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Output")
l!l&&r!l&&!r
000
MC/DC0%0/5
int @tokens > 1 and $tokens[-1]->isa("WWW::Shopify::Liquid::Token::Text") and $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Tag") || $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Output") and $tokens[-2]{"strip_right"}
int @tokens > 1 $tokens[-1]->isa("WWW::Shopify::Liquid::Token::Text") $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Tag") $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Output") $tokens[-2]{"strip_right"}
Truth table0%0/7
A and B and C or D and E
A= int @tokens > 1B= $tokens[-1]->isa("WWW::Shopify::Liquid::Token::Text")C= $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Tag")D= $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Output")E= $tokens[-2]{"strip_right"}
ABCDEresult
0XXXX0
10XXX0
1100X0
111X00
110100
111X11
110111
475 0 ▶ if ($tokens[-1]->isa('WWW::Shopify::Liquid::Token::Text::Whitespace')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tokens[-1]->isa('WWW::Shopify::Liquid::Token::Text::Whitespace')) { } 0 0 0
476 0 splice(@tokens, -1, 1);
477 } else {
478 0 $tokens[-1]->{core} =~ s/^\s+//ms;
479 }
480 }
481
482 0 $start_line = $line;
483 0 $start_column = $start_element->[2] - $line_position;
484 0 $position = [$start_line, $start_column, $start_element->[2], $self->file_context];
485 0 $start_element = $position;
486 }
487 0 ▶ push(@tokens, WWW::Shopify::Liquid::Token::Tag->new($start_element, $tag, [$self->parse_expression($position, $arguments)], $start_tag_strip, $end_tag_strip)) if $tag;
Branch: 1 branch
BranchTrueFalseTotal
if $tag 0 0 0
488 0 ▶ push(@tokens, WWW::Shopify::Liquid::Token::Output->new($start_element, [$self->parse_expression($position, $output)], $start_tag_strip, $end_tag_strip)) if $output;
Branch: 1 branch
BranchTrueFalseTotal
if $output 0 0 0
489 0 $start = $end_element->[2];
490 0 $start_line = $line;
491 0 $start_column = $column;
492 }
493 # Strip whitespace.
494 0 ▶ if ($tag && $start_tag_strip && int(@tokens) > 1 && $tokens[-2]->isa('WWW::Shopify::Liquid::Token::Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tag and $start_tag_strip and int @tokens > 1 and $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Text")) 0 0 0
Condition0%0/9
$tag and $start_tag_strip and int @tokens > 1 and $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Text")
!ll&&!rl&&r
000
$tag and $start_tag_strip and int @tokens > 1
!ll&&!rl&&r
000
$tag and $start_tag_strip
!ll&&!rl&&r
000
MC/DC0%0/4
$tag and $start_tag_strip and int @tokens > 1 and $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Text")
$tag $start_tag_strip int @tokens > 1 $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Text")
Truth table0%0/5
A and B and C and D
A= $tagB= $start_tag_stripC= int @tokens > 1D= $tokens[-2]->isa("WWW::Shopify::Liquid::Token::Text")
ABCDresult
0XXX0
10XX0
110X0
11100
11111
495 0 ▶ if ($tokens[-2]->isa('WWW::Shopify::Liquid::Token::Text::Whitespace')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tokens[-2]->isa('WWW::Shopify::Liquid::Token::Text::Whitespace')) { } 0 0 0
496 0 splice(@tokens, -2, 1);
497 } else {
498 0 $tokens[-2]->{core} =~ s/\s+$//ms;
499 }
500 }
501
502 }
503 0 ▶ die new WWW::Shopify::Liquid::Exception::Lexer::UnbalancedSingleQuote($open_single_quote) if $open_single_quote;
Branch: 1 branch
BranchTrueFalseTotal
if $open_single_quote 0 0 0
504 0 ▶ die new WWW::Shopify::Liquid::Exception::Lexer::UnbalancedDoubleQuote($open_double_quote) if $open_double_quote;
Branch: 1 branch
BranchTrueFalseTotal
if $open_double_quote 0 0 0
505 0 ▶ die new WWW::Shopify::Liquid::Exception::Lexer::UnbalancedTag($open_tag) if $open_tag;
Branch: 1 branch
BranchTrueFalseTotal
if $open_tag 0 0 0
506 0 ▶ die new WWW::Shopify::Liquid::Exception::Lexer::UnbalancedLexingHalt() if $lexing_halter;
Branch: 1 branch
BranchTrueFalseTotal
if $lexing_halter 0 0 0
507 0 ▶ die new WWW::Shopify::Liquid::Exception::Lexer::UnbalancedOutputTag($open_output_tag) if $open_output_tag;
Branch: 1 branch
BranchTrueFalseTotal
if $open_output_tag 0 0 0
508 0 return @tokens;
509 }
510  
511 sub unparse_token {
512 0 ▶ my ($self, $token) = @_;
Subroutine unparse_token: not called CC=10 SCAR=47.0
Pod undocumented
513 0 ▶ return "null" if !defined $token;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $token 0 0 0
514 0 ▶ return '' if $token eq '';
Branch: 1 branch
BranchTrueFalseTotal
if $token eq "" 0 0 0
515 0 ▶ return "'" . do { $token =~ s/'/\\'/g; $token } . "'" if !blessed($token) && !looks_like_number($token);
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($token) or &looks_like_number($token) 0 0 0
Condition0%0/3
builtin::blessed($token) or &looks_like_number($token)
l!l&&r!l&&!r
000
MC/DC0%0/2
builtin::blessed($token) or &looks_like_number($token)
builtin::blessed($token) &looks_like_number($token)
Truth table0%0/3
A or B
A= builtin::blessed($token)B= &looks_like_number($token)
ABresult
1X1
011
000
516 0 ▶ return $token unless blessed($token);
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($token) 0 0 0
517 0 ▶ return "null" if $token->isa('WWW::Shopify::Liquid::Token::NULL');
Branch: 1 branch
BranchTrueFalseTotal
if $token->isa("WWW::Shopify::Liquid::Token::NULL") 0 0 0
518 sub translate_variable {
519 0 ▶ my ($self, $token) = @_;
Subroutine translate_variable: not called CC=3 SCAR=24.8
Pod undocumented
520 my $variable = join(".", map {
521 !$self->is_processed($_) ? (
522 $_->isa('WWW::Shopify::Liquid::Token::Variable') ? ('[' . translate_variable($self, $_) . ']') : $_->{core}
523 0 ▶ ) : $_
Branch: 2 branches
BranchTrueFalseTotal
!$self->is_processed($_) ? : 0 0 0
$_->isa('WWW::Shopify::Liquid::Token::Variable') ? : 0 0 0
524 0 } @{$token->{core}});
525 0 $variable =~ s/\.\[/\[/g;
526 0 return $variable;
527 }
528
529 0 ▶ return translate_variable($self, $token) if $token->isa('WWW::Shopify::Liquid::Token::Variable');
Branch: 1 branch
BranchTrueFalseTotal
if $token->isa("WWW::Shopify::Liquid::Token::Variable") 0 0 0
530 0 ▶ return "(" . join("", map { $self->unparse_token($_); } @{$token->{members}}) . ")" if $token->isa('WWW::Shopify::Liquid::Token::Grouping');
Branch: 1 branch
BranchTrueFalseTotal
if $token->isa("WWW::Shopify::Liquid::Token::Grouping") 0 0 0
531 0 ▶ return "'" . $token->{core} . "'" if $token->isa('WWW::Shopify::Liquid::Token::String');
Branch: 1 branch
BranchTrueFalseTotal
if $token->isa("WWW::Shopify::Liquid::Token::String") 0 0 0
532 0 return $token->{core};
533 }
534  
535 sub unparse_expression {
536 0 ▶ my ($self, @tokens) = @_;
Subroutine unparse_expression: not called CC=3 SCAR=24.8
Pod undocumented
537 0 ▶ my $a = join("", map { ($_ eq ":" || $_ eq ",") ? $_ : " " . $_; } grep { defined $_ } map { $self->unparse_token($_) } @tokens);
Branch: 1 branch
BranchTrueFalseTotal
$_ eq ':' || $_ eq ',' ? : 0 0 0
Condition0%0/3
$_ eq ":" or $_ eq ","
l!l&&r!l&&!r
000
MC/DC0%0/2
$_ eq ":" or $_ eq ","
$_ eq ":" $_ eq ","
Truth table0%0/3
A or B
A= $_ eq ":"B= $_ eq ","
ABresult
1X1
011
000
538 0 $a =~ s/^ //;
539 0 return $a;
540 }
541  
542 sub unparse_text_segment {
543 0 ▶ my ($self, $token) = @_;
Subroutine unparse_text_segment: not called CC=7 SCAR=40.3
Pod undocumented
544 0 ▶ my $space = $self->unparse_spaces ? " " : "";
Branch: 1 branch
BranchTrueFalseTotal
$self->unparse_spaces ? : 0 0 0
545 0 ▶ return $token if $self->is_processed($token);
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_processed($token) 0 0 0
546 0 ▶ if ($token->isa('WWW::Shopify::Liquid::Token::Tag')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($token->isa("WWW::Shopify::Liquid::Token::Tag")) 0 0 0
547 0 ▶ return "{%" . $space . $token->{tag} . $space . "%}" if !$token->{arguments} || int(@{$token->{arguments}}) == 0;
Branch: 1 branch
BranchTrueFalseTotal
if not $token->{"arguments"} or int @{$token->{"arguments"};} == 0 0 0 0
Condition0%0/3
not $token->{"arguments"} or int @{$token->{"arguments"};} == 0
l!l&&r!l&&!r
000
MC/DC0%0/2
not $token->{"arguments"} or int @{$token->{"arguments"};} == 0
not $token->{"arguments"} int @{$token->{"arguments"};} == 0
Truth table0%0/3
not(A) or B
A= not $token->{"arguments"}B= int @{$token->{"arguments"};} == 0
ABresult
1X1
011
000
548 0 return "{%" . $space . $token->{tag} . " " . $self->unparse_expression(@{$token->{arguments}}) . $space . "%}";
549 }
550 0 ▶ return "{{" . $space . $self->unparse_expression(@{$token->{core}}) . $space . "}}" if $token->isa('WWW::Shopify::Liquid::Token::Output');
Branch: 1 branch
BranchTrueFalseTotal
if $token->isa("WWW::Shopify::Liquid::Token::Output") 0 0 0
551 0 return $token->{core};
552 }
553  
554 sub unparse_text {
555 0 ▶ my ($self, @tokens) = @_;
Subroutine unparse_text: not called CC=1 SCAR=6.9
Pod undocumented
556 0 return join('', grep { defined $_ } map { $self->unparse_text_segment($_) } @tokens);
557 }
558  
559 24 1;
↑ Summary blib/lib/WWW/Shopify/Liquid/Tag/Assign.pm »