Branch Coverage

blib/lib/YAML/PP/Parser.pm
Criterion Covered Total %
branch 204 238 85.7


line true false branch
8 0 51 $ENV{'YAML_PP_TRACE'} ? :
9 1 50 $ENV{'YAML_PP_DEBUG'} || $ENV{'YAML_PP_TRACE'} ? :
36 3924 756 if ($receiver)
55 3924 765 if (ref $receiver eq 'CODE') { }
160 162 7441 if (my $error = $@)
161 124 38 if (ref $error)
180 7450 24504 unless @$next_tokens
184 6100 18404 if $next->{'name'} ne "SPACE"
189 14021 4383 if (not $space) { }
195 678 17726 if ($flow)
196 675 3 if ($space >= $indent)
202 7888 9838 if ($space > $indent)
203 6065 1823 if $indent < 0
204 4 1819 unless ($self->new_node)
209 1287 8551 if ($self->new_node) { }
210 437 850 if ($space < $indent) { }
218 561 289 if ($seq_start and $exp eq 'MAPVALUE' || $exp eq 'MAP') { }
226 1905 6646 if ($space < $indent)
233 240 9598 if ($exp eq "SEQ0" and $next->{'name'} ne "DASH")
239 4 9834 if ($self->offset->[-1] != $space)
346 69 7500 unless ($self->lex_next_tokens)
350 7500 0 unless ($self->new_node)
351 0 7500 if ($self->level > 0)
352 0 0 unless my $new_rule = $nodetypes{$event_types->[-1]}
360 0 7500 unless my $rule = $YAML::PP::Parser::GRAMMAR->{$rule_name}
371 0 202119 unless (@$next_tokens)
376 27016 175103 if ($got eq "CONTEXT")
379 22611 4405 unless $self->lexer->flowcontext
385 113859 61244 if ($def) { }
61196 48 elsif ($def = $rule->{'DEFAULT'}) { }
399 83217 91838 if (my $sub = $def->{'match'})
401 79431 3786 @$tokens ? :
405 93367 81655 if ($new) { }
16834 64821 elsif ($eol) { }
6352 58469 elsif ($def->{'return'}) { }
413 0 6352 unless $rule_name = $nodetypes{$event_types->[-1]}
422 24386 92167 if ($eol)
423 7381 16993 unless ($self->lex_next_tokens)
424 1 7380 if ($rule_name eq "DIRECTIVE")
430 11898 5095 unless ($self->new_node)
431 11020 878 if ($self->level > 0)
432 0 11020 unless $rule_name = $nodetypes{$event_types->[-1]}
439 0 109160 unless $rule = $YAML::PP::Parser::GRAMMAR->{$rule_name}
464 10921 8279 if ($offset->[-1] <= $space)
467 51 8228 if ($exp eq "MAPVALUE")
497 154 8073 if ($directive)
514 561 2661 if ($offsets->[-1] == $offset) { }
523 227 2995 if (@$event_stack and $event_stack->[-1][0] eq "properties")
535 156 1222 if ($new_offset < 0) { }
1163 59 elsif ($self->new_node) { }
539 982 181 unless ($event_types->[-1] =~ /^FLOW/)
548 38 1340 if (@$event_stack and $event_stack->[-1][0] eq "properties")
559 375 756 if ($new_offset < 0) { }
658 98 elsif ($self->new_node) { }
563 570 88 unless ($event_types->[-1] =~ /^FLOW/)
567 9 1122 $implicit_flowseq_map ? :
572 69 1062 if (@$event_stack and $event_stack->[-1][0] eq "properties")
585 230 1124 if ($event_types->[-1] =~ /^FLOW|^IMAP/) { }
600 176 933 if ($event_types->[-1] =~ /^FLOW|^IMAP/) { }
622 492 4888 if (@$event_stack and $event_stack->[-1][0] eq "properties")
633 1 8586 if ($event_types->[-1] =~ /FLOW/)
636 499 8087 if ($self->new_node)
641 472 8107 if ($event_types->[-1] eq "STR")
645 0 8107 if ($last ne "DOC" and $last ne "DOC_END")
653 8031 73 if ($self->yaml_version eq "1.2")
665 0 7441 unless $last eq "STR"
678 3424 0 if ($properties)
681 0 3472 if (exists $info->{$type})
685 3032 440 unless (defined $property_offset)
691 2895 529 unless $properties->{'newline'}
694 2895 529 unless ($properties)
701 1164 0 if ($properties)
704 1 1335 if (exists $info->{$type})
717 445 29369 if (@$event_stack and $event_stack->[-1][0] eq "properties")
731 2 548 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 61 2 @$next ? :
922 61 2 @$next ? :
926 38 25 if ($next_line)
927 36 2 if ($self->lexer->offset > 0) { }
964 2229 500 if (not @$stack or $stack->[-1][0] ne "properties")
979 75 2654 if ($tag eq '!') { }
133 2521 elsif ($tag =~ /^!<(.*)>/) { }
2521 0 elsif ($tag =~ /^(![^!]*!|!)(.+)/) { }
989 2289 232 if (exists $map->{$alias}) { }
993 2 230 if ($alias ne "!" and $alias ne "!!")
1010 1840 249 if (not @$stack or $stack->[-1][0] ne "properties")
1026 0 1191 unless my $inline = delete $last->{'inline'}
1039 72 3820 if (@$stack and $stack->[-1][0] eq "properties")
1055 714 17047 unless $last
1058 9 17028 if ($e->[-1] eq "IMAP")
1071 9 104 if (@$stack and $stack->[-1][0] eq "properties")
1159 2013 1992 $subtokens->[0]{'value'} eq '"' ? :
1160 236 3769 if (@$stack and $stack->[-1][0] eq "properties")
1176 419 68 $subtokens->[0]{'value'} eq '"' ? :
1177 16 471 if (@$stack and $stack->[-1][0] eq "properties")
1198 9 229 if (@$stack and $stack->[-1][0] eq "properties")
1213 2212 13357 if (@$stack and $stack->[-1][0] eq "properties")
1240 1682 658 if ($event_types->[-1] =~ /^FLOWSEQ/)
1259 243 159 if (@$stack and $stack->[-1][0] eq "properties")
1286 21 917 if (@$stack and $stack->[-1][0] eq "properties")
1302 132 8 $subtokens->[0]{'value'} eq '"' ? :
1303 2 138 if (@$stack and $stack->[-1][0] eq "properties")
1332 167 402 if (@$stack and $stack->[-1][0] eq "properties")
1398 248 182 if (@$stack and $stack->[-1][0] eq "properties")
1416 1178 532 $type eq '|' ? :
1417 82 1628 if (@$stack and $stack->[-1][0] eq "properties")
1461 1 158 if ($self->yaml_version_directive)