lib/Jemplate/Parser.pm

filter: Statementstmt 81.8% 18 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 80.6% 25 / 31 SCAR 7.2
CC
2
Cov
75%
new
3.7
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« blib/lib/Jemplate/Parser.pm ↑ Summary blib/lib/Jemplate/Grammar.pm »
1 package Jemplate::Parser;
2 51 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 51 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 51 ▶use base 'Template::Parser';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 51 ▶use Jemplate::Grammar;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 51 ▶use Jemplate::Directive;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub new {
10 19 ▶ my $class = shift;
Subroutine new: called CC=2 SCAR=13.0
Pod documented
11 19 my $parser = $class->SUPER::new(
12 GRAMMAR => Jemplate::Grammar->new(),
13 FACTORY => 'Jemplate::Directive',
14 @_,
15 );
16
17 # flags passed from Jemplate object
18 0 my %args = @_;
19  
20 # eval-javascript is default "on"
21 $parser->{EVAL_JAVASCRIPT} = exists $args{EVAL_JAVASCRIPT}
22 0 ▶ ? $args{EVAL_JAVASCRIPT} : 1;
Branch: 1 branch
BranchTrueFalseTotal
exists $args{'EVAL_JAVASCRIPT'} ? : 0 0 0
23
24 # tie the parser state-variable to the global Directive var
25 0 $parser->{INJAVASCRIPT} = \$Jemplate::Directive::INJAVASCRIPT;
26  
27 0 return $parser;
28 }
29  
30 51 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
« blib/lib/Jemplate/Parser.pm ↑ Summary blib/lib/Jemplate/Grammar.pm »