Branch Coverage

lib/Template/Parser.pm
Criterion Covered Total %
branch 152 182 83.5


line true false branch
131 132 1 $_[0] && ref $_[0] eq 'HASH' ? :
155 95 2033 if defined $$config{$key}
160 15 118 if (defined($debug = $$config{'DEBUG'})) { }
0 118 elsif ($DEBUG == 1) { }
183 132 1 unless (ref $$self{'FACTORY'})
195 0 133 unless $self->new_style($config)
230 155 3 @$blocks ? :
252 133 1 unless $$styles[-1]
255 3 131 if ($tagstyle = $$config{'TAG_STYLE'})
256 0 3 unless defined($tags = $$TAG_STYLE{$tagstyle})
265 98 1108 if defined $$config{$key}
280 0 149 if (defined $out) { }
320 0 1 unless @$styles > 1
340 1289 0 unless defined $$info{'DEBUG'}
363 3 1286 unless $block
366 0 1286 if $$self{'DEBUG'} & 64
390 112 1177 $$self{'ANYCASE'} ? :
398 7 1282 unless defined $text and length $text
403 3762 0 defined $2 ? :
404 0 3762 unless defined $pre
405 0 3762 unless defined $dir
412 11 3751 if (/^\#/) { }
414 4 7 $dir =~ /($CHOMP_FLAGS)$/o ? :
418 3741 10 if (s/^($CHOMP_FLAGS)?(\s*)//os and $2)
426 119 3632 $1 ? :
428 118 3633 if ($chomp and $pre)
430 109 9 if ($chomp == 1) { }
6 3 elsif ($chomp == 2) { }
3 0 elsif ($chomp == 3) { }
444 1009 2753 $1 ? :
446 1841 1921 if ($chomp)
447 1832 9 if ($chomp == 1) { }
6 3 elsif ($chomp == 2) { }
3 0 elsif ($chomp == 3) { }
448 1685 147 if $text =~ s/ ^ ([^\S\n]* \n) //x
452 6 0 if $text =~ s/ ^ (\s+) / /x
457 3 0 if $text =~ s/ ^ (\s+) //x
464 2075 1687 if (length $pre)
465 528 1547 $interp ? :
472 3747 15 if (length $dir)
474 15 3732 if ($dir =~ /^$tags_dir\s+(.*)/) { }
476 7 8 if (scalar @tags > 1) { }
8 0 elsif ($tags = $$TAG_STYLE{$tags[0]}) { }
491 199 3533 $dirlines ? :
506 215 729 $interp ? :
944 338 if length $text
544 1092 309 if (defined $pre and length $pre)
550 309 1092 if ($var) { }
0 1092 elsif ($dir) { }
639 24 17042 if $1
642 1368 15674 if (defined($token = $3)) { }
717 14957 elsif (defined($token = $4)) { }
26 14931 elsif (defined($token = $5)) { }
8715 6216 elsif (defined($token = $6)) { }
6216 0 elsif (defined($token = $7)) { }
644 316 1052 if ($2 eq '"') { }
645 172 144 if ($token =~ /[\$\\]/) { }
683 780 7935 if ($anycase) { }
687 469 311 if (@tokens and $$ANYCASE_AFTER{$tokens[-2]} or $text =~ /$ANYCASE_BEFORE/cg) { }
699 2231 6484 if (defined($type = $$lextable{$uctoken})) { }
708 530 5686 $anycase ? :
709 0 6216 unless (defined($type = $$lextable{$uctoken}))
745 0 154 if $$self{'DEBUG'} & 64
763 0 30 unless @$stack
792 13 3455 unless $$self{'FILE_INFO'}
839 0 1289 if $$self{'TRACE_VARS'}
858 44169 48454 if (exists $$state{'ACTIONS'}) { }
864 4781 24793 if (ref $token) { }
866 4039 742 if (ref $token) { }
742 0 elsif ($token eq 'ITEXT') { }
867 15 4024 if ($$info{'DEBUG'} and not $in_string) { }
898 13 729 if ($inperl) { }
913 344 24449 if $token eq '"'
919 1287 42882 unless defined $token
922 15125 3 defined($lookup = $$state{'DEFAULT'}) ? :
29041 15128 defined($lookup = $$state{'ACTIONS'}{$token}) ? :
934 3 92620 unless defined $action
939 26090 66530 if ($action > 0)
951 1286 65244 unless $action
956 21555 44975 unless $code
959 64470 2060 $len ? :
965 0 66530 if ($@)
975 1286 65244 if $status == 1
980 0 65244 if $status == 3
984 0 65244 if $status == 2
992 1 2 unless defined $value
998 0 2 if $value eq ';'
1016 3 0 ref $line ? :
1017 0 3 unless $line
1019 2 1 if defined $text
1042 0 0 unless defined $val