Branch Coverage

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


line true false branch
7 0 42 $ENV{'YAML_PP_TRACE'} ? :
8 1 41 $ENV{'YAML_PP_DEBUG'} || $ENV{'YAML_PP_TRACE'} ? :
137 6446 41017 if (defined $next_line)
142 11822 29195 unless (defined $line)
148 0 29195 unless $line =~ /\A( *)([^\r\n]*)([\r\n]|\z)/
152 29 29166 if (Deparse error: Can't locate object method "unctrl" via package " " (perhaps you forgot to load " "?) at /usr/local/lib/perl5/5.26.1/B/Deparse.pm line 5203. )
183 798 31102 if @$next
186 7425 23648 unless ($next_line)
192 157 23491 unless (length $$yaml)
197 546 22945 if (substr($$yaml, 0, 1) eq "#")
202 326 22619 if (not $spaces and substr($$yaml, 0, 1) eq "%")
208 4269 18350 if (not $spaces and $$yaml =~ s/\A(---|\.\.\.)(?=$RE_WS|\z)//) { }
59 18291 elsif ($self->flowcontext and $$yaml =~ /\A[ \t]+(#.*)?\z/) { }
221 4686 17868 unless ($partial)
255 6625 67864 unless (length $$yaml)
263 1781 66083 if ($self->context)
264 142 1639 if ($$yaml =~ s/\A($RE_WS*)://)
265 11 131 if $1
270 9 1630 if ($$yaml =~ s/\A($RE_WS*(?: #.*))\z//)
277 6344 61369 if ($CONTEXT{$first}) { }
19543 41826 elsif ($COLON_DASH_QUESTION{$first}) { }
5369 36457 elsif ($ANCHOR_ALIAS_TAG{$first}) { }
9094 27363 elsif ($first eq ' ' or $first eq "\t") { }
7228 20135 elsif ($FLOW{$first}) { }
284 19018 525 if ($$yaml =~ s/\A\Q$first\E($RE_WS+|\z)//) { }
7 953 elsif ($self->flowcontext and $$yaml =~ s/\A:(?=[,\{\}\[\]])//) { }
286 8 17849 unless ($self->flowcontext or $self->block)
291 80 18930 if ($after =~ tr/\t//)
296 0 19010 unless (defined $1)
302 2520 16490 if ($$yaml =~ s/\A(#.*|)\z//)
319 5369 0 if ($$yaml =~ s/\A$REGEX//) { }
329 9094 0 if ($$yaml =~ s/\A($RE_WS+)//)
331 208 8886 if ($$yaml =~ s/\A((?:#.*)?\z)//)
343 2471 4757 if ($first eq '{' or $first eq '[') { }
2460 2297 elsif ($first eq '}' or $first eq ']') { }
354 20653 21483 if ($plain)
371 2631 17983 if ($self->flowcontext)
376 7 20607 unless ($$yaml =~ s/\A($REGEX)//)
383 10026 10581 if ($$yaml =~ s/\A(?:($RE_WS+#.*)|($RE_WS*))\z//) { }
384 130 9896 if (defined $1) { }
398 3067 7512 unless ($partial)
405 124 9772 if ($self->flowcontext)
413 3582 6680 unless ($next_line)
420 107 6573 unless (length $$yaml)
427 622 5951 if (not $spaces and $$yaml =~ s/\A(---|\.\.\.)(?=$RE_WS|\z)//)
432 5548 403 if (length $spaces < $indent)
437 25 378 if ($$yaml =~ s/\A($RE_WS+)//)
440 11 392 unless (length $$yaml)
446 9 383 if ($$yaml =~ s/\A(#.*)\z//)
452 297 86 if ($$yaml =~ s/\A($RE2)//) { }
458 41 256 if ($$yaml =~ s/\A($RE_WS+)//)
461 248 49 unless (length $$yaml)
467 17 32 if ($$yaml =~ s/\A(#.*)\z//) { }
473 9 23 if $ws
480 86 0 if ($self->flowcontext) { }
495 242 9654 if (@lines > 1) { }
498 210 32 if ($tokens[-3] eq "EOL")
508 740 9156 if ($fetch_next)
510 599 141 unless ($partial)
525 0 1720 unless $$yaml =~ s/\A\Q$context\E//
531 214 1506 if ($$yaml =~ s/\A([1-9])([+-]?)//) { }
409 1097 elsif ($$yaml =~ s/\A([+-])([1-9])?//) { }
534 85 129 if $2
535 85 129 if $2
540 9 400 if $2
541 9 400 if $2
543 223 1497 if ($set_indent)
545 189 34 if $indent > 0
548 1662 58 if (not length $$yaml) { }
52 6 elsif ($$yaml =~ s/\A($RE_WS*(?:$RE_WS#.*|))\z//) { }
563 814 4443 unless ($next_line)
569 200 4243 if (not $spaces and $content =~ /\A(---|\.\.\.)(?=$RE_WS|\z)/)
572 1436 2807 if (length $spaces < $current_indent)
573 700 736 if (length $content) { }
574 2 698 if ($content =~ /\A\t/)
586 1571 1236 if (length $spaces > $current_indent)
587 370 1201 if ($started)
592 257 2550 unless (length $content)
595 131 126 unless ($started)
600 1383 1167 unless ($started)
625 0 4624 unless $$yaml =~ s/\A\Q$context\E//
632 842 4624 unless ($start)
633 1 841 unless ($next_line = $self->_fetch_next_line)
636 1 2 if (ref $token)
647 157 684 if (not length $$yaml) { }
3 681 elsif (not $spaces and $$yaml =~ /\A(---|\.\.\.)(?=$RE_WS|\z)/) { }
3 678 elsif (length $spaces < $indent) { }
656 3 6 if (ref $token)
666 3 6 if (ref $token)
674 95 583 if ($$yaml =~ s/\A($RE_WS+)//)
682 4615 685 if ($tokens[-3] eq $token_name)
683 4129 486 if ($start) { }
694 1772 2843 if $self->flowcontext
695 2486 2129 if (length $$yaml) { }
697 1010 1476 unless ($partial)
722 2139 3163 if ($first eq q[']) { }
724 2139 0 if ($$yaml =~ s/\A($regex)//)
729 85 2054 unless (length $$yaml)
730 24 61 if ($quoted =~ s/($RE_WS+)\z//)
741 4615 687 if ($$yaml =~ s/\A$first//)
742 4129 486 if ($start) { }
751 2 685 if (length $$yaml)
770 5522 3737 if ($$yaml =~ s/\A([^"\\ \t]+)//)
775 1466 7793 if ($$yaml =~ s/\A($RE_ESCAPES)//)
777 17 1 defined $4 ? :
95 18 defined $3 ? :
1353 113 defined $2 ? :
784 2740 6519 if ($$yaml =~ s/\A([ \t]+)//)
786 2599 141 if (length $$yaml) { }
796 82 9036 if ($$yaml =~ s/\A(\\)\z//)
801 2940 6096 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 125608 26997 unless $name eq "CONTEXT"
896 24383 128222 if ($name eq "EOL")
921 5293 23546 if (ref $value eq 'HASH') { }
929 4712 24127 if ($push->{'name'} eq "EOL")
944 0 61 @$next ? :
947 60 1 if (my $nl = $self->next_line)