Branch Coverage

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


line true false branch
8 0 42 $ENV{'YAML_PP_TRACE'} ? :
9 1 41 $ENV{'YAML_PP_DEBUG'} || $ENV{'YAML_PP_TRACE'} ? :
36 3911 747 if ($receiver)
55 3911 756 if (ref $receiver eq 'CODE') { }
160 155 7416 if (my $error = $@)
161 124 31 if (ref $error)
180 7425 24443 unless @$next_tokens
184 6072 18371 if $next->{'name'} ne "SPACE"
189 13988 4383 if (not $space) { }
195 678 17693 if ($flow)
196 675 3 if ($space >= $indent)
202 7856 9837 if ($space > $indent)
203 6033 1823 if $indent < 0
204 4 1819 unless ($self->new_node)
209 1287 8550 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 6645 if ($space < $indent)
233 240 9597 if ($exp eq "SEQ0" and $next->{'name'} ne "DASH")
239 4 9833 if ($self->offset->[-1] != $space)
346 69 7468 unless ($self->lex_next_tokens)
350 7468 0 unless ($self->new_node)
351 0 7468 if ($self->level > 0)
352 0 0 unless my $new_rule = $nodetypes{$event_types->[-1]}
360 0 7468 unless my $rule = $YAML::PP::Parser::GRAMMAR->{$rule_name}
371 0 201676 unless (@$next_tokens)
376 26958 174718 if ($got eq "CONTEXT")
379 22555 4403 unless $self->lexer->flowcontext
385 113624 61094 if ($def) { }
61046 48 elsif ($def = $rule->{'DEFAULT'}) { }
399 83025 91645 if (my $sub = $def->{'match'})
401 79250 3775 @$tokens ? :
405 93141 81503 if ($new) { }
16801 64702 elsif ($eol) { }
6344 58358 elsif ($def->{'return'}) { }
413 0 6344 unless $rule_name = $nodetypes{$event_types->[-1]}
422 24332 91954 if ($eol)
423 7356 16964 unless ($self->lex_next_tokens)
424 1 7355 if ($rule_name eq "DIRECTIVE")
430 11890 5074 unless ($self->new_node)
431 11013 877 if ($self->level > 0)
432 0 11013 unless $rule_name = $nodetypes{$event_types->[-1]}
439 0 108918 unless $rule = $YAML::PP::Parser::GRAMMAR->{$rule_name}
464 10890 8252 if ($offset->[-1] <= $space)
467 51 8201 if ($exp eq "MAPVALUE")
497 154 8040 if ($directive)
514 561 2661 if ($offsets->[-1] == $offset) { }
523 227 2995 if (@$event_stack and $event_stack->[-1][0] eq "properties")
535 153 1208 if ($new_offset < 0) { }
1149 59 elsif ($self->new_node) { }
539 982 167 unless ($event_types->[-1] =~ /^FLOW/)
548 38 1323 if (@$event_stack and $event_stack->[-1][0] eq "properties")
559 372 746 if ($new_offset < 0) { }
648 98 elsif ($self->new_node) { }
563 570 78 unless ($event_types->[-1] =~ /^FLOW/)
567 9 1109 $implicit_flowseq_map ? :
572 69 1049 if (@$event_stack and $event_stack->[-1][0] eq "properties")
585 226 1123 if ($event_types->[-1] =~ /^FLOW|^IMAP/) { }
600 176 932 if ($event_types->[-1] =~ /^FLOW|^IMAP/) { }
622 492 4861 if (@$event_stack and $event_stack->[-1][0] eq "properties")
633 1 8555 if ($event_types->[-1] =~ /FLOW/)
636 499 8056 if ($self->new_node)
641 470 8078 if ($event_types->[-1] eq "STR")
645 0 8078 if ($last ne "DOC" and $last ne "DOC_END")
653 8005 73 if ($self->yaml_version eq "1.2")
665 0 7416 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 29311 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 709 17018 unless $last
1058 9 16999 if ($e->[-1] eq "IMAP")
1071 9 104 if (@$stack and $stack->[-1][0] eq "properties")
1159 2011 1981 $subtokens->[0]{'value'} eq '"' ? :
1160 236 3756 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 13313 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 7 $subtokens->[0]{'value'} eq '"' ? :
1303 2 137 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)