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