line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Mustache::Token::Template; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:YANICK'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Object representing a Template block |
4
|
|
|
|
|
|
|
$Template::Mustache::Token::Template::VERSION = '1.3.3'; |
5
|
20
|
|
|
20
|
|
145
|
use Moo; |
|
20
|
|
|
|
|
47
|
|
|
20
|
|
|
|
|
152
|
|
6
|
|
|
|
|
|
|
|
7
|
20
|
|
|
20
|
|
9016
|
use MooseX::MungeHas { has_ro => [ 'is_ro' ] }; |
|
20
|
|
|
|
|
49
|
|
|
20
|
|
|
|
|
150
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has_ro 'items'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has escape => ( |
12
|
|
|
|
|
|
|
is => 'rw', |
13
|
|
|
|
|
|
|
lazy => 1, default => sub { 1 }, |
14
|
|
|
|
|
|
|
predicate => 1, |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub flatten { |
18
|
163
|
50
|
|
163
|
0
|
345
|
return map { ref $_ eq 'ARRAY' ? flatten(@$_) : $_ } grep { ref } @_; |
|
485
|
|
|
|
|
1117
|
|
|
485
|
|
|
|
|
902
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub render { |
22
|
163
|
|
|
163
|
0
|
785
|
my( $self, $context, $partials, $indent ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
485
|
100
|
|
|
|
1881
|
my @nodes = grep { ref $_ ne 'Template::Mustache::Token::Verbatim' or |
25
|
163
|
|
|
|
|
264
|
length $_->content } flatten( @{ $self->items } ); |
|
163
|
|
|
|
|
591
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$_->can('has_escape') and ( $_->has_escape or $_->escape($self->escape) ) |
28
|
163
|
|
33
|
|
|
3381
|
for @nodes; |
|
|
|
66
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
163
|
100
|
66
|
|
|
3582
|
if( @nodes and ref $nodes[-1] eq 'Template::Mustache::Token::Verbatim' ) { |
31
|
38
|
|
|
|
|
159
|
$nodes[-1]->last(1); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
163
|
|
|
|
|
359
|
return join '', map { $_->render($context, $partials, $indent ) } @nodes; |
|
321
|
|
|
|
|
1038
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=pod |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=encoding UTF-8 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Template::Mustache::Token::Template - Object representing a Template block |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 VERSION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
version 1.3.3 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHORS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=over 4 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=item * |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Pieter van de Bruggen <pvande@cpan.org> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item * |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Yanick Champoux <yanick@cpan.org> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item * |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Ricardo Signes <rjbs@cpan.org> |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=back |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This software is copyright (c) 2019, 2018, 2017, 2016, 2015, 2011 by Pieter van de Bruggen. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
76
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |