Branch Coverage

blib/lib/YAML/PP/Parser.pm
Criterion Covered Total %
branch 180 238 75.6


line true false branch
8 0 42 $ENV{'YAML_PP_TRACE'} ? :
9 1 41 $ENV{'YAML_PP_DEBUG'} || $ENV{'YAML_PP_TRACE'} ? :
36 265 185 if ($receiver)
55 265 194 if (ref $receiver eq 'CODE') { }
160 65 1662 if (my $error = $@)
161 38 27 if (ref $error)
180 1669 5560 unless @$next_tokens
184 1879 3681 if $next->{'name'} ne "SPACE"
189 2655 1026 if (not $space) { }
195 87 3594 if ($flow)
196 87 0 if ($space >= $indent)
202 1116 2478 if ($space > $indent)
203 678 438 if $indent < 0
204 0 438 unless ($self->new_node)
209 511 1967 if ($self->new_node) { }
210 342 169 if ($space < $indent) { }
218 77 92 if ($seq_start and $exp eq 'MAPVALUE' || $exp eq 'MAP') { }
226 548 1419 if ($space < $indent)
233 29 2449 if ($exp eq "SEQ0" and $next->{'name'} ne "DASH")
239 0 2478 if ($self->offset->[-1] != $space)
346 0 1696 unless ($self->lex_next_tokens)
350 1696 0 unless ($self->new_node)
351 0 1696 if ($self->level > 0)
352 0 0 unless my $new_rule = $nodetypes{$event_types->[-1]}
360 0 1696 unless my $rule = $YAML::PP::Parser::GRAMMAR->{$rule_name}
371 0 52246 unless (@$next_tokens)
376 5703 46543 if ($got eq "CONTEXT")
379 4030 1673 unless $self->lexer->flowcontext
385 30097 16446 if ($def) { }
16444 2 elsif ($def = $rule->{'DEFAULT'}) { }
399 20972 25569 if (my $sub = $def->{'match'})
401 20606 366 @$tokens ? :
405 25667 20854 if ($new) { }
3886 16968 elsif ($eol) { }
2570 14398 elsif ($def->{'return'}) { }
413 0 2570 unless $rule_name = $nodetypes{$event_types->[-1]}
422 5533 26590 if ($eol)
423 1669 3864 unless ($self->lex_next_tokens)
424 0 1669 if ($rule_name eq "DIRECTIVE")
430 2888 976 unless ($self->new_node)
431 2762 126 if ($self->level > 0)
432 0 2762 unless $rule_name = $nodetypes{$event_types->[-1]}
439 0 30454 unless $rule = $YAML::PP::Parser::GRAMMAR->{$rule_name}
464 2800 1669 if ($offset->[-1] <= $space)
467 9 1660 if ($exp eq "MAPVALUE")
497 47 1780 if ($directive)
514 77 636 if ($offsets->[-1] == $offset) { }
523 19 694 if (@$event_stack and $event_stack->[-1][0] eq "properties")
535 11 798 if ($new_offset < 0) { }
776 22 elsif ($self->new_node) { }
539 771 5 unless ($event_types->[-1] =~ /^FLOW/)
548 10 799 if (@$event_stack and $event_stack->[-1][0] eq "properties")
559 13 336 if ($new_offset < 0) { }
309 27 elsif ($self->new_node) { }
563 302 7 unless ($event_types->[-1] =~ /^FLOW/)
567 0 349 $implicit_flowseq_map ? :
572 25 324 if (@$event_stack and $event_stack->[-1][0] eq "properties")
585 27 782 if ($event_types->[-1] =~ /^FLOW|^IMAP/) { }
600 34 306 if ($event_types->[-1] =~ /^FLOW|^IMAP/) { }
622 54 952 if (@$event_stack and $event_stack->[-1][0] eq "properties")
633 0 1917 if ($event_types->[-1] =~ /FLOW/)
636 50 1867 if ($self->new_node)
641 117 1793 if ($event_types->[-1] eq "STR")
645 0 1793 if ($last ne "DOC" and $last ne "DOC_END")
653 1747 46 if ($self->yaml_version eq "1.2")
665 0 1662 unless $last eq "STR"
678 1228 0 if ($properties)
681 0 1440 if (exists $info->{$type})
685 1175 265 unless (defined $property_offset)
691 1175 53 unless $properties->{'newline'}
694 1175 53 unless ($properties)
701 246 0 if ($properties)
704 0 355 if (exists $info->{$type})
717 173 7067 if (@$event_stack and $event_stack->[-1][0] eq "properties")
731 0 138 if (@$event_stack and $event_stack->[-1][0] eq "properties")
745 5 0 $type eq 'string' ? :
750 1 4 if ($error)
764 1 0 if ($next_line)
765 1 0 if ($self->lexer->offset > 0) { }
773 0 1 unless defined $remaining
782 0 0 if (ref $event eq "ARRAY")
805 0 0 defined $_ ? :
817 0 0 if (@$next_tokens)
826 0 1 unless defined $line
868 0 0 if (ref $rule eq 'ARRAY') { }
870 0 0 if (ref $first eq 'SCALAR') { }
874 0 0 if (ref $first eq "ARRAY")
921 2 0 @$next ? :
922 2 0 @$next ? :
926 2 0 if ($next_line)
927 2 0 if ($self->lexer->offset > 0) { }
964 839 298 if (not @$stack or $stack->[-1][0] ne "properties")
979 0 1137 if ($tag eq '!') { }
1 1136 elsif ($tag =~ /^!<(.*)>/) { }
1136 0 elsif ($tag =~ /^(![^!]*!|!)(.+)/) { }
989 1041 95 if (exists $map->{$alias}) { }
993 1 94 if ($alias ne "!" and $alias ne "!!")
1010 584 76 if (not @$stack or $stack->[-1][0] ne "properties")
1026 0 246 unless my $inline = delete $last->{'inline'}
1039 0 454 if (@$stack and $stack->[-1][0] eq "properties")
1055 410 4132 unless $last
1058 0 4123 if ($e->[-1] eq "IMAP")
1071 0 19 if (@$stack and $stack->[-1][0] eq "properties")
1159 714 1572 $subtokens->[0]{'value'} eq '"' ? :
1160 22 2264 if (@$stack and $stack->[-1][0] eq "properties")
1176 112 0 $subtokens->[0]{'value'} eq '"' ? :
1177 2 110 if (@$stack and $stack->[-1][0] eq "properties")
1198 0 0 if (@$stack and $stack->[-1][0] eq "properties")
1213 601 1957 if (@$stack and $stack->[-1][0] eq "properties")
1240 1113 268 if ($event_types->[-1] =~ /^FLOWSEQ/)
1259 216 98 if (@$stack and $stack->[-1][0] eq "properties")
1286 0 94 if (@$stack and $stack->[-1][0] eq "properties")
1302 1 0 $subtokens->[0]{'value'} eq '"' ? :
1303 0 1 if (@$stack and $stack->[-1][0] eq "properties")
1332 162 321 if (@$stack and $stack->[-1][0] eq "properties")
1398 162 72 if (@$stack and $stack->[-1][0] eq "properties")
1416 116 76 $type eq '|' ? :
1417 28 164 if (@$stack and $stack->[-1][0] eq "properties")
1461 0 47 if ($self->yaml_version_directive)