blib/lib/Jemplate/Parser.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 30 SCAR 17.9
CC
2
Cov
0%
new
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 6.0
1 package Jemplate::Parser;
2 use strict;
3 use warnings;
4 use base 'Template::Parser';
5  
6 use Jemplate::Grammar;
7 use Jemplate::Directive;
8  
9 sub new {
10 my $class = shift;
11 my $parser = $class->SUPER::new(
12 GRAMMAR => Jemplate::Grammar->new(),
13 FACTORY => 'Jemplate::Directive',
14 @_,
15 );
16
17 # flags passed from Jemplate object
18 my %args = @_;
19  
20 # eval-javascript is default "on"
21 $parser->{EVAL_JAVASCRIPT} = exists $args{EVAL_JAVASCRIPT}
22 ? $args{EVAL_JAVASCRIPT} : 1;
23
24 # tie the parser state-variable to the global Directive var
25 $parser->{INJAVASCRIPT} = \$Jemplate::Directive::INJAVASCRIPT;
26  
27 return $parser;
28 }
29  
30 1;
31  
32 =head1 NAME
33  
34 Jemplate::Parser - Jemplate Parser Subclass
35  
36 =head1 SYNOPSIS
37  
38 use Jemplate::Parser;
39  
40 =head1 DESCRIPTION
41  
42 Jemplate::Parser is a simple subclass of Template::Parser. Not much
43 to see here.
44  
45 =head1 AUTHOR
46  
47 Ingy döt Net <ingy@cpan.org>
48  
49 =head1 COPYRIGHT
50  
51 Copyright (c) 2006-2008. Ingy döt Net. All rights reserved.
52  
53 This program is free software; you can redistribute it and/or modify it
54 under the same terms as Perl itself.
55  
56 See L<http://www.perl.com/perl/misc/Artistic.html>
57  
58 =cut