Branch Coverage

lib/Template/Parser.pm
Criterion Covered Total %
branch 148 176 84.0


line true false branch
106 132 1 $_[0] && ref $_[0] eq 'HASH' ? :
129 95 1900 if defined $$config{$key}
134 15 118 if (defined($debug = $$config{'DEBUG'})) { }
0 118 elsif ($DEBUG == 1) { }
157 132 1 unless (ref $$self{'FACTORY'})
169 0 133 unless $self->new_style($config)
204 155 3 @$blocks ? :
226 133 1 unless $$styles[-1]
229 3 131 if ($tagstyle = $$config{'TAG_STYLE'})
230 0 3 unless defined($tags = $$TAG_STYLE{$tagstyle})
238 98 974 if defined $$config{$key}
255 0 1 unless @$styles > 1
275 1281 0 unless defined $$info{'DEBUG'}
298 3 1278 unless $block
301 0 1278 if $$self{'DEBUG'} & 64
325 111 1170 $$self{'ANYCASE'} ? :
331 7 1274 unless defined $text and length $text
344 0 3753 unless defined $pre
345 0 3753 unless defined $dir
352 11 3742 if (/^\#/) { }
354 4 7 $dir =~ /($CHOMP_FLAGS)$/o ? :
358 3732 10 if (s/^($CHOMP_FLAGS)?(\s*)//os and $2)
366 119 3623 $1 ? :
368 118 3624 if ($chomp and $pre)
370 109 9 if ($chomp == 1) { }
6 3 elsif ($chomp == 2) { }
3 0 elsif ($chomp == 3) { }
384 1008 2745 $1 ? :
386 1840 1913 if ($chomp)
387 1831 9 if ($chomp == 1) { }
6 3 elsif ($chomp == 2) { }
3 0 elsif ($chomp == 3) { }
388 1684 147 if $text =~ s/ ^ ([^\S\n]* \n) //x
392 6 0 if $text =~ s/ ^ (\s+) / /x
397 3 0 if $text =~ s/ ^ (\s+) //x
404 2075 1678 if (length $pre)
405 528 1547 $interp ? :
412 3738 15 if (length $dir)
414 15 3723 if ($dir =~ /^$tags_dir\s+(.*)/) { }
416 7 8 if (scalar @tags > 1) { }
8 0 elsif ($tags = $$TAG_STYLE{$tags[0]}) { }
429 197 3526 $dirlines ? :
444 213 723 $interp ? :
936 338 if length $text
482 1090 309 if (defined $pre and length $pre)
488 309 1090 if ($var) { }
0 1090 elsif ($dir) { }
577 24 16999 if $1
580 1359 15640 if (defined($token = $3)) { }
716 14924 elsif (defined($token = $4)) { }
26 14898 elsif (defined($token = $5)) { }
8699 6199 elsif (defined($token = $6)) { }
6199 0 elsif (defined($token = $7)) { }
582 308 1051 if ($2 eq '"') { }
583 172 136 if ($token =~ /[\$\\]/) { }
621 609 8090 $anycase && (!@tokens || $tokens[-2] ne 'DOT') ? :
625 2228 6471 if (defined($type = $$lextable{$uctoken})) { }
634 528 5671 $anycase ? :
635 0 6199 unless (defined($type = $$lextable{$uctoken}))
671 0 154 if $$self{'DEBUG'} & 64
689 0 30 unless @$stack
718 13 3443 unless $$self{'FILE_INFO'}
765 0 1281 if $$self{'TRACE_VARS'}
784 44028 48303 if (exists $$state{'ACTIONS'}) { }
790 4770 24733 if (ref $token) { }
792 4030 740 if (ref $token) { }
740 0 elsif ($token eq 'ITEXT') { }
793 15 4015 if ($$info{'DEBUG'} and not $in_string) { }
824 13 727 if ($inperl) { }
839 344 24389 if $token eq '"'
845 1279 42749 unless defined $token
848 15064 3 defined($lookup = $$state{'DEFAULT'}) ? :
28961 15067 defined($lookup = $$state{'ACTIONS'}{$token}) ? :
860 3 92328 unless defined $action
865 26022 66306 if ($action > 0)
877 1278 65028 unless $action
882 21458 44848 unless $code
885 64256 2050 $len ? :
891 0 66306 if ($@)
901 1278 65028 if $status == 1
906 0 65028 if $status == 3
910 0 65028 if $status == 2
918 1 2 unless defined $value
924 0 2 if $value eq ';'
942 3 0 ref $line ? :
943 0 3 unless $line
945 2 1 if defined $text
968 0 0 unless defined $val