line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dancer::Template::Semantic; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
2
|
|
|
2
|
|
1761
|
$Dancer::Template::Semantic::VERSION = '0.01'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
17
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
67
|
|
7
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
79
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
2183
|
use Dancer::Config 'setting'; |
|
2
|
|
|
|
|
134629
|
|
|
2
|
|
|
|
|
140
|
|
10
|
2
|
|
|
2
|
|
22
|
use Dancer::ModuleLoader; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
56
|
|
11
|
2
|
|
|
2
|
|
10
|
use Dancer::FileUtils 'path'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
84
|
|
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
11
|
use base 'Dancer::Template::Abstract'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
451
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $_engine; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub init { |
18
|
1
|
|
|
1
|
1
|
952
|
my ($self) = @_; |
19
|
|
|
|
|
|
|
|
20
|
1
|
50
|
|
|
|
6
|
die "Template::Semantic is needed by Dancer::Template::Semantic" |
21
|
|
|
|
|
|
|
unless Dancer::ModuleLoader->load('Template::Semantic'); |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
$_engine = Template::Semantic->new; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub render { |
27
|
0
|
|
|
0
|
1
|
|
my ($self, $template, $tokens) = @_; |
28
|
0
|
0
|
0
|
|
|
|
die "'$template' is not a regular file" |
29
|
|
|
|
|
|
|
if !ref($template) && (!-f $template); |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
my $content = $_engine->process($template, $tokens) or die $_engine->error; |
32
|
0
|
|
|
|
|
|
return $content; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |