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         30  
  8         204  
3 8     8   34 use warnings;
  8         17  
  8         201  
4 8     8   36 use base 'Template::Parser';
  8         16  
  8         45  
5              
6             our $VERSION = '0.15';
7              
8 8     8   4662 use Lemplate::Grammar;
  8         6739  
  8         311  
9 8     8   3243 use Lemplate::Directive;
  8         23  
  8         765  
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__