Branch Coverage

lib/Template/Parser.pm
Criterion Covered Total %
branch 155 182 85.1


line true false branch
131 141 2 $_[0] && ref $_[0] eq 'HASH' ? :
155 101 2187 if defined $config->{$key}
160 15 128 if (defined($debug = $config->{'DEBUG'})) { }
0 128 elsif ($DEBUG == 1) { }
183 142 1 unless (ref $self->{'FACTORY'})
195 0 143 unless $self->new_style($config)
230 155 3 @$blocks ? :
252 143 1 unless $styles->[-1]
255 5 139 if ($tagstyle = $config->{'TAG_STYLE'})
257 0 5 unless defined($tags = $Template::Parser::TAG_STYLE->{$tagstyle})
265 107 1189 if defined $config->{$key}
280 6 157 if (defined $out) { }
320 0 1 unless @$styles > 1
340 1310 0 unless defined $info->{'DEBUG'}
363 3 1307 unless $block
366 0 1307 if $self->{'DEBUG'} & 64
390 115 1196 $self->{'ANYCASE'} ? :
398 8 1303 unless defined $text and length $text
403 3818 15 defined $2 ? :
404 0 3833 unless defined $pre
405 0 3833 unless defined $dir
412 11 3822 if (/^\#/) { }
414 4 7 $dir =~ /($CHOMP_FLAGS)$/o ? :
418 3808 14 if (s/^($CHOMP_FLAGS)?(\s*)//os and $2)
426 121 3701 $1 ? :
428 120 3702 if ($chomp and $pre)
430 111 9 if ($chomp == 1) { }
6 3 elsif ($chomp == 2) { }
3 0 elsif ($chomp == 3) { }
444 1020 2813 $1 ? :
446 1856 1977 if ($chomp)
447 1847 9 if ($chomp == 1) { }
6 3 elsif ($chomp == 2) { }
3 0 elsif ($chomp == 3) { }
448 1697 150 if $text =~ s/ ^ ([^\S\n]* \n) //x
452 6 0 if $text =~ s/ ^ (\s+) / /x
457 3 0 if $text =~ s/ ^ (\s+) //x
464 2119 1714 if (length $pre)
465 528 1591 $interp ? :
472 3818 15 if (length $dir)
474 19 3799 if ($dir =~ /^$tags_dir\s+(.*)/) { }
476 8 11 if (scalar @tags > 1) { }
11 0 elsif ($tags = $$TAG_STYLE{$tags[0]}) { }
491 206 3593 $dirlines ? :
506 215 745 $interp ? :
960 343 if length $text
544 1095 311 if (defined $pre and length $pre)
550 311 1095 if ($var) { }
0 1095 elsif ($dir) { }
639 25 17277 if $1
642 1385 15892 if (defined($token = $3)) { }
721 15171 elsif (defined($token = $4)) { }
26 15145 elsif (defined($token = $5)) { }
8846 6299 elsif (defined($token = $6)) { }
6299 0 elsif (defined($token = $7)) { }
644 323 1062 if ($2 eq '"') { }
645 173 150 if ($token =~ /[\$\\]/) { }
683 817 8029 if ($anycase) { }
687 491 326 if (@tokens and $$ANYCASE_AFTER{$tokens[-2]} or $text =~ /$ANYCASE_BEFORE/cg) { }
699 2274 6572 if (defined($type = $lextable->{$uctoken})) { }
708 547 5752 $anycase ? :
709 0 6299 unless (defined($type = $lextable->{$uctoken}))
745 0 157 if $self->{'DEBUG'} & 64
763 0 30 unless @$stack
792 13 3515 unless $self->{'FILE_INFO'}
839 1 1309 if $self->{'TRACE_VARS'}
858 44826 49182 if (exists $state->{'ACTIONS'}) { }
864 4849 25157 if (ref $token) { }
866 4107 742 if (ref $token) { }
742 0 elsif ($token eq 'ITEXT') { }
867 15 4092 if ($info->{'DEBUG'} and not $in_string) { }
898 13 729 if ($inperl) { }
913 346 24811 if $token eq '"'
919 1308 43518 unless defined $token
924 15344 3 defined($lookup = $state->{'DEFAULT'}) ? :
29479 15347 defined($lookup = $state->{'ACTIONS'}{$token}) ? :
934 3 94005 unless defined $action
939 26475 67530 if ($action > 0)
951 1307 66223 unless $action
956 21870 45660 unless $code
959 65447 2083 $len ? :
965 0 67530 if ($@)
975 1307 66223 if $status == 1
980 0 66223 if $status == 3
984 0 66223 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