Branch Coverage

blib/lib/Text/Xslate/Compiler.pm
Criterion Covered Total %
branch 219 256 85.5


line true false branch
207 1 237 if (ref $syntax) { }
261 28219 19901 ref $file ? :
281 3434 5 if (my $engine = $self->engine)
297 2212 1227 unless ($args{'omit_augment'})
298 9 2203 if ($header)
301 9 2203 if ($footer)
305 2 3437 if ($macro)
306 2 0 unless (grep {$_ eq $self->current_file;} @$macro)
323 73 3302 if (defined $cascade)
327 3370 0 if $self->has_macro_table
329 3370 0 if ($OPTIMIZE)
352 47809 3959 unless (defined $file)
354 1957 45852 if (defined $file and $file ne $self->current_file) { }
375 5898 7 unless ($list_op)
398 144 17705 unless defined $ast
403 4585 13120 ref $ast eq 'ARRAY' ? :
404 0 28252 unless &Scalar::Util::blessed($node)
426 11 62 $cascade->second ? :
430 66 7 if (defined $base) { }
439 0 7 if (defined $args->{'fullpath'})
456 100 58 if ($c->[0] eq 'macro_begin' .. $c->[0] eq 'macro_end') { }
0 58 elsif ($c->[0] eq 'depend') { }
457 23 77 if ($c->[0] eq 'macro_begin') { }
0 77 elsif ($c->[0] eq 'macro_nargs') { }
0 77 elsif ($c->[0] eq 'macro_outer') { }
23 54 elsif ($c->[0] eq 'macro_end') { }
488 63 7 if (defined $base) { }
490 13 48 if (defined $vars)
495 0 166 if ($c->[0] eq 'print_raw_s' and $c->[1] =~ / [^ \t\r\n] /msx)
514 661 68 if ($c->[0] ne 'macro_begin')
523 2 66 if (exists $mtable->{$name})
525 0 2 if (ref $m ne 'HASH')
541 25 41 if (defined $before)
552 21 45 if (defined $around)
561 7 135 if ($body[$j][0] eq 'super')
570 24 42 if (defined $after)
585 29 229 ref $macros eq 'ARRAY' ? :
592 87 171 if $macro->{'nargs'}
595 11 247 if $macro->{'outer'}
608 71 378 if (defined(my $lvar_id = $self->lvar->{$id}))
610 23 48 if (defined $code) { }
634 0 2381 unless $OPTIMIZE
635 0 2381 unless $name eq 'print' or $name eq 'print_raw'
652 28 12616 if ($proc eq 'print' and $self->type eq 'text')
657 5 12670 if ($proc eq 'print' and $self->overridden_builtin->{'html_escape'}) { }
10289 2381 elsif (exists $Text::Xslate::OPS{$proc . '_s'} and $arg->arity eq 'literal') { }
27 2354 elsif ($self->_can_optimize_print($proc, $arg)) { }
676 15 12 $builtin{$filter_name}[0] eq 'builtin_mark_raw' ? :
694 0 12635 unless (@code)
704 3 1250 ref $file eq 'ARRAY' ? :
711 17 1236 if (defined(my $vars = $node->second))
723 68 14 if (ref $file eq 'ARRAY') { }
13 1 elsif ($file->arity eq 'literal') { }
736 0 73 if (defined $self->cascade)
749 25 1595 if (any_in($op->[0], ('pushmark', 'loop_control')))
760 10 1630 if ($op->[0] eq 'loop_control')
766 6 4 if $type eq 'last'
779 0 170 if (@{$vars;} != 1)
836 0 25 if (@{$vars;} > 1)
852 10 15 if (@{$vars;})
873 0 12 unless any_in($type, ('last', 'next'))
876 2 10 unless ($self->{'in_loop'})
881 2 8 if ($self->{'in_loop'} == 1 and $type eq 'last')
883 0 2 unless defined $lvar_id
931 235 76 if (any_in($type, ('macro', 'block'))) { }
932 2 233 if (exists $self->macro_table->{$name})
934 2 0 if (p(\%macro) ne p($m))
966 167 251 if ($expr->is_logical and any_in($expr->id, ('==', '!=')))
968 39 128 if ($rhs->arity eq 'nil')
973 18 21 if ($expr->id eq '==')
1007 393 0 if ($OPTIMIZE)
1008 100 293 if ($self->_code_is_literal(@cond))
1010 96 4 $cond_true eq 'and' ? :
75 25 if ($cond_true eq 'and' ? $value : !$value) { }
1019 217 76 if (@then and @else or not $OPTIMIZE) { }
72 4 elsif (not @else) { }
1050 0 39 if (@{$vars;} > 1)
1074 420 2735 if (defined(my $lvar_id = $self->lvar->{$node->value})) { }
1079 8 2727 if ($name =~ /~/)
1111 45 86 $node->id eq '{' ? :
1124 33 0 if (exists $unary{$id}) { }
1130 17 16 if ($OPTIMIZE and $self->_code_is_literal(@operand))
1148 250 54 if ($field->arity eq 'literal') { }
1157 14 40 if ($OPTIMIZE and $self->_code_is_literal(@rhs))
1179 702 223 if (exists $binary{$id}) { }
223 0 elsif (exists $logical_binary{$id}) { }
1190 26 676 if (any_in($id, ('min', 'max')))
1201 702 0 if ($OPTIMIZE)
1202 123 579 if ($self->_code_is_literal(@lhs) and $self->_code_is_literal(@rhs))
1222 0 7 unless $self->can_be_in_list_context
1256 54 403 if (my $intern = $builtin{$callable->id} and not $self->overridden_builtin->{$callable->id})
1257 0 54 if (@{$args;} != 1)
1279 0 43 unless (defined $lvar_id)
1296 0 16 unless (defined $lvar_id)
1316 0 59 if ($node->id ne '=')
1322 47 12 if ($is_decl)
1327 1 58 if (not exists $lvar->{$lvar_name} or $lhs->arity ne 'variable')
1349 72 0 if ($OPTIMIZE)
1350 33 39 if (@expr == 1 and any_in($expr[0][0], ('literal', 'load_lvar')))
1368 8 23 if (@pairs % 2 != 0)
1369 7 1 if (@pairs == 1) { }
1379 0 28 unless (any_in($key->arity, ('literal', 'variable')))
1406 7 7 if ($funcname =~ /::_generate_(\w+) \z/msx)
1428 0 140 unless my $engine = $self->engine
1439 0 140 if ($@)
1474 3459 121604 if (exists $goto_family{$c->[$i][0]})
1478 2874 585 $addr > 0 ? :
1490 14415 110648 if ($name eq 'print_raw_s') { }
1222 109426 elsif ($name eq 'save_to_lvar') { }
19333 90093 elsif ($name eq 'literal') { }
138 89955 elsif ($name eq 'fetch_field') { }
1495 5499 307 unless $goto_addr[$i]
5651 155 unless $goto_addr[$j]
1515 580 642 if (defined $nn and $nn->[0] eq 'load_lvar_to_sb' and $nn->[1] == $it->[1])
1524 916 18417 if (is_int($c->[$i][1]))
1531 0 138 if ($prev->[0] =~ /^literal/)
1542 5576 113911 if ($c->[$i][0] eq 'noop')
1543 388 5188 if (defined $goto_addr[$i])
1546 431 165 $goto->[1] > 0 ? :
1553 616 4960 if @goto_addr > $i
1565 0 47 if $addix
1568 0 47 if ref $name
1570 11 36 if (defined $arg)
1573 28 19 if (defined $line)
1575 7 21 if (defined $file)
1579 0 47 if (defined $label)
1582 4 43 if (defined $comment)
1593 13 5 ref $node ? :