Branch Coverage

blib/lib/YAML/PP/Lexer.pm
Criterion Covered Total %
branch 244 260 93.8


line true false branch
7 0 51 $ENV{'YAML_PP_TRACE'} ? :
8 1 50 $ENV{'YAML_PP_DEBUG'} || $ENV{'YAML_PP_TRACE'} ? :
137 6447 41107 if (defined $next_line)
142 11860 29247 unless (defined $line)
148 0 29247 unless $line =~ /\A( *)([^\r\n]*)([\r\n]|\z)/
152 29 29218 if ($line =~ tr/\000-\b\cK\f\cN-\037//)
183 806 31177 if @$next
186 7449 23699 unless ($next_line)
192 157 23542 unless (length $$yaml)
197 546 22996 if (substr($$yaml, 0, 1) eq "#")
202 326 22670 if (not $spaces and substr($$yaml, 0, 1) eq "%")
208 4292 18378 if (not $spaces and $$yaml =~ s/\A(---|\.\.\.)(?=$RE_WS|\z)//) { }
59 18319 elsif ($self->flowcontext and $$yaml =~ /\A[ \t]+(#.*)?\z/) { }
221 4708 17897 unless ($partial)
255 6656 67955 unless (length $$yaml)
263 1782 66173 if ($self->context)
264 143 1639 if ($$yaml =~ s/\A($RE_WS*)://)
265 11 132 if $1
270 9 1630 if ($$yaml =~ s/\A($RE_WS*(?: #.*))\z//)
277 6361 61442 if ($CONTEXT{$first}) { }
19571 41871 elsif ($COLON_DASH_QUESTION{$first}) { }
5369 36502 elsif ($ANCHOR_ALIAS_TAG{$first}) { }
9096 27406 elsif ($first eq ' ' or $first eq "\t") { }
7230 20176 elsif ($FLOW{$first}) { }
284 19046 525 if ($$yaml =~ s/\A\Q$first\E($RE_WS+|\z)//) { }
7 953 elsif ($self->flowcontext and $$yaml =~ s/\A:(?=[,\{\}\[\]])//) { }
286 8 17877 unless ($self->flowcontext or $self->block)
291 80 18958 if ($after =~ tr/\t//)
296 0 19038 unless (defined $1)
302 2520 16518 if ($$yaml =~ s/\A(#.*|)\z//)
319 5369 0 if ($$yaml =~ s/\A$REGEX//) { }
329 9096 0 if ($$yaml =~ s/\A($RE_WS+)//)
331 208 8888 if ($$yaml =~ s/\A((?:#.*)?\z)//)
343 2472 4758 if ($first eq '{' or $first eq '[') { }
2461 2297 elsif ($first eq '}' or $first eq ']') { }
354 20694 21487 if ($plain)
371 2632 18023 if ($self->flowcontext)
376 7 20648 unless ($$yaml =~ s/\A($REGEX(?:[:]+(?=\:(\s|\z)))?)//)
383 10051 10597 if ($$yaml =~ s/\A(?:($RE_WS+#.*)|($RE_WS*))\z//) { }
384 130 9921 if (defined $1) { }
398 3068 7527 unless ($partial)
405 124 9797 if ($self->flowcontext)
413 3598 6683 unless ($next_line)
420 104 6579 unless (length $$yaml)
427 630 5949 if (not $spaces and $$yaml =~ s/\A(---|\.\.\.)(?=$RE_WS|\z)//)
432 5549 400 if (length $spaces < $indent)
437 25 375 if ($$yaml =~ s/\A($RE_WS+)//)
440 11 389 unless (length $$yaml)
446 9 380 if ($$yaml =~ s/\A(#.*)\z//)
452 294 86 if ($$yaml =~ s/\A($RE2)//) { }
458 41 253 if ($$yaml =~ s/\A($RE_WS+)//)
461 245 49 unless (length $$yaml)
467 17 32 if ($$yaml =~ s/\A(#.*)\z//) { }
473 9 23 if $ws
480 86 0 if ($self->flowcontext) { }
495 239 9682 if (@lines > 1) { }
498 207 32 if ($tokens[-3] eq "EOL")
508 748 9173 if ($fetch_next)
510 607 141 unless ($partial)
525 0 1718 unless $$yaml =~ s/\A\Q$context\E//
531 215 1503 if ($$yaml =~ s/\A([1-9])([+-]?)//) { }
409 1094 elsif ($$yaml =~ s/\A([+-])([1-9])?//) { }
534 85 130 if $2
535 85 130 if $2
540 9 400 if $2
541 9 400 if $2
543 224 1494 if ($set_indent)
545 190 34 if $indent > 0
548 1660 58 if (not length $$yaml) { }
52 6 elsif ($$yaml =~ s/\A($RE_WS*(?:$RE_WS#.*|))\z//) { }
563 812 4436 unless ($next_line)
569 200 4236 if (not $spaces and $content =~ /\A(---|\.\.\.)(?=$RE_WS|\z)/)
572 1434 2802 if (length $spaces < $current_indent)
573 700 734 if (length $content) { }
574 2 698 if ($content =~ /\A\t/)
586 1568 1234 if (length $spaces > $current_indent)
587 370 1198 if ($started)
592 257 2545 unless (length $content)
595 131 126 unless ($started)
600 1380 1165 unless ($started)
625 0 4643 unless $$yaml =~ s/\A\Q$context\E//
632 848 4643 unless ($start)
633 1 847 unless ($next_line = $self->_fetch_next_line)
636 1 2 if (ref $token)
647 160 687 if (not length $$yaml) { }
3 684 elsif (not $spaces and $$yaml =~ /\A(---|\.\.\.)(?=$RE_WS|\z)/) { }
3 681 elsif (length $spaces < $indent) { }
656 3 6 if (ref $token)
666 3 6 if (ref $token)
674 95 586 if ($$yaml =~ s/\A($RE_WS+)//)
682 4634 688 if ($tokens[-3] eq $token_name)
683 4145 489 if ($start) { }
694 1773 2861 if $self->flowcontext
695 2500 2134 if (length $$yaml) { }
697 1010 1490 unless ($partial)
722 2157 3167 if ($first eq q[']) { }
724 2157 0 if ($$yaml =~ s/\A($regex)//)
729 88 2069 unless (length $$yaml)
730 24 64 if ($quoted =~ s/($RE_WS+)\z//)
741 4634 690 if ($$yaml =~ s/\A$first//)
742 4145 489 if ($start) { }
751 2 688 if (length $$yaml)
770 5528 3747 if ($$yaml =~ s/\A([^"\\ \t]+)//)
775 1475 7800 if ($$yaml =~ s/\A($RE_ESCAPES)//)
777 17 1 defined $4 ? :
95 18 defined $3 ? :
1362 113 defined $2 ? :
784 2742 6533 if ($$yaml =~ s/\A([ \t]+)//)
786 2601 141 if (length $$yaml) { }
796 82 9052 if ($$yaml =~ s/\A(\\)\z//)
801 2944 6108 if $last
812 163 163 if ($$yaml =~ s/\A(\s*%YAML[ \t]+([0-9]+\.[0-9]+))//) { }
118 45 elsif ($$yaml =~ s/\A(\s*%TAG[ \t]+(!$RE_NS_WORD_CHAR*!|!)[ \t]+(tag:\S+|!$RE_URI_CHAR+))($RE_WS*)//) { }
45 0 elsif ($$yaml =~ s/\A(\s*\A%(?:\w+).*)//) { }
815 28 135 if ($$yaml =~ s/\A($RE_WS+)//) { }
1 134 elsif (length $$yaml) { }
823 9 153 unless ($version =~ /^1\.[12]$/)
824 0 9 if ($warn eq 'warn') { }
0 9 elsif ($warn eq 'fatal') { }
844 0 45 if ($warn eq 'warn') { }
0 45 elsif ($warn eq 'fatal') { }
857 297 28 if (not length $$yaml) { }
27 1 elsif ($trailing_ws and $$yaml =~ s/\A(#.*)?\z//) { }
0 1 elsif ($$yaml =~ s/\A([ \t]+#.*)?\z//) { }
894 125831 27055 unless $name eq "CONTEXT"
896 24442 128444 if ($name eq "EOL")
921 5315 23557 if (ref $value eq 'HASH') { }
929 4705 24167 if ($push->{'name'} eq "EOL")
944 0 61 @$next ? :
947 60 1 if (my $nl = $self->next_line)