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