line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lemplate::Parser; |
2
|
8
|
|
|
8
|
|
54
|
use strict; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
198
|
|
3
|
8
|
|
|
8
|
|
38
|
use warnings; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
211
|
|
4
|
8
|
|
|
8
|
|
37
|
use base 'Template::Parser'; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
54
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
7
|
|
|
|
|
|
|
|
8
|
8
|
|
|
8
|
|
4780
|
use Lemplate::Grammar; |
|
8
|
|
|
|
|
6819
|
|
|
8
|
|
|
|
|
394
|
|
9
|
8
|
|
|
8
|
|
3773
|
use Lemplate::Directive; |
|
8
|
|
|
|
|
24
|
|
|
8
|
|
|
|
|
777
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
13
|
0
|
|
|
|
|
|
my $parser = $class->SUPER::new( |
14
|
|
|
|
|
|
|
GRAMMAR => Lemplate::Grammar->new(), |
15
|
|
|
|
|
|
|
FACTORY => 'Lemplate::Directive', |
16
|
|
|
|
|
|
|
@_, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# flags passed from Lemplate object |
20
|
0
|
|
|
|
|
|
my %args = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# eval-javascript is default "on" |
23
|
|
|
|
|
|
|
$parser->{EVAL_JAVASCRIPT} = exists $args{EVAL_JAVASCRIPT} |
24
|
0
|
0
|
|
|
|
|
? $args{EVAL_JAVASCRIPT} : 1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# tie the parser state-variable to the global Directive var |
27
|
0
|
|
|
|
|
|
$parser->{INJAVASCRIPT} = \$Lemplate::Directive::INJAVASCRIPT; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
return $parser; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |