| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Template::Mustache::Token::Section; |
|
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:YANICK'; |
|
3
|
|
|
|
|
|
|
# ABSTRACT: Object representing a Section block |
|
4
|
|
|
|
|
|
|
$Template::Mustache::Token::Section::VERSION = '1.3.4'; |
|
5
|
20
|
|
|
20
|
|
125
|
use Moo; |
|
|
20
|
|
|
|
|
36
|
|
|
|
20
|
|
|
|
|
111
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
20
|
|
|
20
|
|
7439
|
use MooseX::MungeHas { has_ro => [ 'is_ro' ] }; |
|
|
20
|
|
|
|
|
44
|
|
|
|
20
|
|
|
|
|
126
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has_ro 'variable'; |
|
10
|
|
|
|
|
|
|
has_ro 'template'; |
|
11
|
|
|
|
|
|
|
has_ro 'inverse'; |
|
12
|
|
|
|
|
|
|
has_ro 'delimiters'; |
|
13
|
|
|
|
|
|
|
has_ro 'raw'; |
|
14
|
|
|
|
|
|
|
|
|
15
|
20
|
|
|
20
|
|
16161
|
use Template::Mustache; |
|
|
20
|
|
|
|
|
44
|
|
|
|
20
|
|
|
|
|
4831
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub render { |
|
18
|
11
|
|
|
11
|
0
|
30
|
my( $self, $context, $partials, $indent ) = @_; |
|
19
|
|
|
|
|
|
|
|
|
20
|
11
|
|
|
|
|
50
|
my $cond = Template::Mustache::resolve_context( $self->variable, $context ); |
|
21
|
|
|
|
|
|
|
|
|
22
|
11
|
100
|
|
|
|
37
|
if ( ref $cond eq 'CODE' ) { |
|
23
|
|
|
|
|
|
|
my $value=Template::Mustache->new( |
|
24
|
|
|
|
|
|
|
delimiters => $self->delimiters, |
|
25
|
|
|
|
|
|
|
template => $cond->( |
|
26
|
|
|
|
|
|
|
$self->raw, |
|
27
|
|
|
|
|
|
|
sub { |
|
28
|
2
|
|
|
2
|
|
51
|
Template::Mustache->new( template=> shift )->parsed->render( |
|
29
|
|
|
|
|
|
|
$context, $partials, $indent |
|
30
|
|
|
|
|
|
|
) } |
|
31
|
|
|
|
|
|
|
) |
|
32
|
2
|
|
|
|
|
22
|
)->parsed->render( $context, $partials ); |
|
33
|
|
|
|
|
|
|
|
|
34
|
2
|
50
|
|
|
|
16
|
return '' if $self->inverse; |
|
35
|
2
|
|
|
|
|
477
|
return $value; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
9
|
50
|
|
|
|
34
|
if ( $self->inverse ) { |
|
39
|
0
|
0
|
|
|
|
0
|
if ( ref $cond eq 'ARRAY' ) { |
|
40
|
0
|
|
|
|
|
0
|
$cond = ! @$cond; |
|
41
|
|
|
|
|
|
|
}else { |
|
42
|
0
|
|
|
|
|
0
|
$cond = !$cond; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
9
|
50
|
|
|
|
22
|
return unless $cond; |
|
47
|
|
|
|
|
|
|
|
|
48
|
9
|
50
|
|
|
|
22
|
return join '', map { $self->template->render( [ $_, @$context ], $partials ) } |
|
|
9
|
|
|
|
|
50
|
|
|
49
|
|
|
|
|
|
|
ref $cond eq 'ARRAY' ? @$cond : ( $cond ); |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=pod |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=encoding UTF-8 |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 NAME |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Template::Mustache::Token::Section - Object representing a Section block |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 VERSION |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
version 1.3.4 |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 AUTHORS |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=over 4 |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item * |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Pieter van de Bruggen <pvande@cpan.org> |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item * |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Yanick Champoux <yanick@cpan.org> |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Ricardo Signes <rjbs@cpan.org> |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=back |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
This software is copyright (c) 2021, 2019, 2018, 2017, 2016, 2015, 2011 by Pieter van de Bruggen. |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
91
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |