File Coverage

blib/lib/Lemplate/Parser.pm
Criterion Covered Total %
statement 15 21 71.4
branch 0 2 0.0
condition n/a
subroutine 5 6 83.3
pod 1 1 100.0
total 21 30 70.0


line stmt bran cond sub pod time code
1             package Lemplate::Parser;
2 8     8   50 use strict;
  8         18  
  8         206  
3 8     8   40 use warnings;
  8         17  
  8         184  
4 8     8   39 use base 'Template::Parser';
  8         19  
  8         39  
5              
6             our $VERSION = '0.13';
7              
8 8     8   4372 use Lemplate::Grammar;
  8         6056  
  8         268  
9 8     8   2798 use Lemplate::Directive;
  8         22  
  8         726  
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__