line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use experimental 'signatures'; |
2
|
25
|
|
|
25
|
|
9581
|
use strict; |
|
25
|
|
|
|
|
73628
|
|
|
25
|
|
|
|
|
128
|
|
3
|
25
|
|
|
25
|
|
3656
|
use warnings; |
|
25
|
|
|
|
|
48
|
|
|
25
|
|
|
|
|
443
|
|
4
|
25
|
|
|
25
|
|
110
|
our $VERSION = '1.0.22'; |
|
25
|
|
|
|
|
42
|
|
|
25
|
|
|
|
|
20148
|
|
5
|
|
|
|
|
|
|
our $FilterSeparator = qr[\s*\|\s*]o; |
6
|
|
|
|
|
|
|
my $ArgumentSeparator = qr[,]o; |
7
|
|
|
|
|
|
|
our $FilterArgumentSeparator = qr[\s*:\s*]o; |
8
|
|
|
|
|
|
|
our $VariableAttributeSeparator = qr[\.]o; |
9
|
|
|
|
|
|
|
our $TagStart = qr[(?:\s*{%-\s*|{%\s*)]o; |
10
|
|
|
|
|
|
|
our $TagEnd = qr[(?:\s*-%}\s*|\s*%})]o; |
11
|
|
|
|
|
|
|
our $VariableSignature = qr{\(?[\w\-\.\[\]]\)?}o; |
12
|
|
|
|
|
|
|
my $VariableSegment = qr[[\w\-]\??]ox; |
13
|
|
|
|
|
|
|
our $VariableStart = qr[(?:\s*\{\{-\s*|\{\{-?\s*)]o; |
14
|
|
|
|
|
|
|
our $VariableEnd = qr[(?:\s*-?}}\s*?|\s*}})]o; |
15
|
|
|
|
|
|
|
my $VariableIncompleteEnd = qr[(?:\s*-}}?\s*|}})]; |
16
|
|
|
|
|
|
|
my $QuotedString = qr/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/o; |
17
|
|
|
|
|
|
|
our $QuotedFragment = qr/${QuotedString}|(?:[^\s,\|'"]|${QuotedString})+/o; |
18
|
|
|
|
|
|
|
my $StrictQuotedFragment = qr/"[^"]+"|'[^']+'|[^\s,\|,\:,\,]+/o; |
19
|
|
|
|
|
|
|
my $FirstFilterArgument |
20
|
|
|
|
|
|
|
= qr/${FilterArgumentSeparator}(?:${StrictQuotedFragment})/o; |
21
|
|
|
|
|
|
|
my $OtherFilterArgument |
22
|
|
|
|
|
|
|
= qr/${ArgumentSeparator}(?:${StrictQuotedFragment})/o; |
23
|
|
|
|
|
|
|
my $SpacelessFilter |
24
|
|
|
|
|
|
|
= qr/${FilterSeparator}(?:${StrictQuotedFragment})(?:${FirstFilterArgument}(?:${OtherFilterArgument})*)?/o; |
25
|
|
|
|
|
|
|
our $Expression = qr/(?:${QuotedFragment}(?:${SpacelessFilter})*)/o; |
26
|
|
|
|
|
|
|
our $TagAttributes = qr[(\w+)(?:\s*\:\s*(${QuotedFragment}))?]o; |
27
|
|
|
|
|
|
|
my $AnyStartingTag = qr[\{\{|\{\%]o; |
28
|
|
|
|
|
|
|
my $PartialTemplateParser |
29
|
|
|
|
|
|
|
= qr[${TagStart}.+?${TagEnd}|${VariableStart}.+?${VariableIncompleteEnd}]os; |
30
|
|
|
|
|
|
|
my $TemplateParser = qr[(${PartialTemplateParser}|${AnyStartingTag})]os; |
31
|
|
|
|
|
|
|
our $VariableParser |
32
|
|
|
|
|
|
|
= qr[${VariableStart}([\w\.]+)(?:\s*\|\s*(.+)\s*)?${VariableEnd}$]so; |
33
|
|
|
|
|
|
|
our $VariableFilterArgumentParser = qr[ |
34
|
|
|
|
|
|
|
(?: |
35
|
|
|
|
|
|
|
(?:\s*,\s*)? |
36
|
|
|
|
|
|
|
(?: |
37
|
|
|
|
|
|
|
((?:\")(?:[^\\\"]*(?:\\.[^\\\"]*)*)(?:\")) |
38
|
|
|
|
|
|
|
|((?:\')(?:[^\\\']*(?:\\.[^\\\']*)*)(?:\')) |
39
|
|
|
|
|
|
|
|(?:([^,]+)(?:\s*,\s*)?) |
40
|
|
|
|
|
|
|
) |
41
|
|
|
|
|
|
|
)]smx; |
42
|
|
|
|
|
|
|
our $TagMatch = qr[^${Template::Liquid::Utility::TagStart} # {% |
43
|
|
|
|
|
|
|
(.+?) # etc |
44
|
|
|
|
|
|
|
${Template::Liquid::Utility::TagEnd} # %} |
45
|
|
|
|
|
|
|
$]sox; |
46
|
|
|
|
|
|
|
our $VarMatch = qr[^${Template::Liquid::Utility::VariableStart} # {{ |
47
|
|
|
|
|
|
|
(.+?) # stuff + filters? |
48
|
|
|
|
|
|
|
${Template::Liquid::Utility::VariableEnd} # }} |
49
|
|
|
|
|
|
|
$]sox; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
map { defined $_ ? $_ : () } split $TemplateParser, shift || ''; |
52
|
|
|
|
|
|
|
} |
53
|
359
|
50
|
50
|
359
|
0
|
6080
|
1; |
|
2030
|
|
|
|
|
4022
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=pod |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=encoding UTF-8 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=begin stopwords |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Lütke jadedPixel |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=end stopwords |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 NAME |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Template::Liquid::Utility - Utility stuff. Watch your step. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 Description |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
It's best to just forget this package exists. It's messy but seems to work. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 See Also |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Liquid for Designers: http://wiki.github.com/tobi/liquid/liquid-for-designers |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
L<Template::Liquid|Template::Liquid/"Create your own filters">'s docs on custom |
78
|
|
|
|
|
|
|
filter creation |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 Author |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/ |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
The original Liquid template system was developed by jadedPixel |
85
|
|
|
|
|
|
|
(http://jadedpixel.com/) and Tobias Lütke (http://blog.leetsoft.com/). |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 License and Legal |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Copyright (C) 2009-2022 by Sanko Robinson E<lt>sanko@cpan.orgE<gt> |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under |
92
|
|
|
|
|
|
|
the terms of The Artistic License 2.0. See the F<LICENSE> file included with |
93
|
|
|
|
|
|
|
this distribution or http://www.perlfoundation.org/artistic_license_2_0. For |
94
|
|
|
|
|
|
|
clarification, see http://www.perlfoundation.org/artistic_2_0_notes. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
When separated from the distribution, all original POD documentation is covered |
97
|
|
|
|
|
|
|
by the Creative Commons Attribution-Share Alike 3.0 License. See |
98
|
|
|
|
|
|
|
http://creativecommons.org/licenses/by-sa/3.0/us/legalcode. For clarification, |
99
|
|
|
|
|
|
|
see http://creativecommons.org/licenses/by-sa/3.0/us/. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |