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 41006 if (defined $next_line)
142 11815 29191 unless (defined $line)
148 0 29191 unless $line =~ /\A( *)([^\r\n]*)([\r\n]|\z)/
152 29 29162 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 800 31103 if @$next
186 7425 23649 unless ($next_line)
192 157 23492 unless (length $$yaml)
197 546 22946 if (substr($$yaml, 0, 1) eq "#")
202 326 22620 if (not $spaces and substr($$yaml, 0, 1) eq "%")
208 4270 18350 if (not $spaces and $$yaml =~ s/\A(---|\.\.\.)(?=$RE_WS|\z)//) { }
59 18291 elsif ($self->flowcontext and $$yaml =~ /\A[ \t]+(#.*)?\z/) { }
221 4687 17868 unless ($partial)
255 6628 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 6347 61366 if ($CONTEXT{$first}) { }
19543 41823 elsif ($COLON_DASH_QUESTION{$first}) { }
5369 36454 elsif ($ANCHOR_ALIAS_TAG{$first}) { }
9094 27360 elsif ($first eq ' ' or $first eq "\t") { }
7228 20132 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 20650 21483 if ($plain)
371 2631 17980 if ($self->flowcontext)
376 7 20604 unless ($$yaml =~ s/\A($REGEX(?:[:]+(?=\:(\s|\z)))?)//)
383 10023 10581 if ($$yaml =~ s/\A(?:($RE_WS+#.*)|($RE_WS*))\z//) { }
384 130 9893 if (defined $1) { }
398 3067 7512 unless ($partial)
405 124 9769 if ($self->flowcontext)
413 3577 6676 unless ($next_line)
420 104 6572 unless (length $$yaml)
427 624 5948 if (not $spaces and $$yaml =~ s/\A(---|\.\.\.)(?=$RE_WS|\z)//)
432 5548 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 9654 if (@lines > 1) { }
498 207 32 if ($tokens[-3] eq "EOL")
508 742 9151 if ($fetch_next)
510 601 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 4629 unless $$yaml =~ s/\A\Q$context\E//
632 848 4629 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 4620 688 if ($tokens[-3] eq $token_name)
683 4131 489 if ($start) { }
694 1772 2848 if $self->flowcontext
695 2486 2134 if (length $$yaml) { }
697 1010 1476 unless ($partial)
722 2145 3165 if ($first eq q[']) { }
724 2145 0 if ($$yaml =~ s/\A($regex)//)
729 88 2057 unless (length $$yaml)
730 24 64 if ($quoted =~ s/($RE_WS+)\z//)
741 4620 690 if ($$yaml =~ s/\A$first//)
742 4131 489 if ($start) { }
751 2 688 if (length $$yaml)
770 5526 3745 if ($$yaml =~ s/\A([^"\\ \t]+)//)
775 1475 7796 if ($$yaml =~ s/\A($RE_ESCAPES)//)
777 17 1 defined $4 ? :
95 18 defined $3 ? :
1362 113 defined $2 ? :
784 2742 6529 if ($$yaml =~ s/\A([ \t]+)//)
786 2601 141 if (length $$yaml) { }
796 82 9048 if ($$yaml =~ s/\A(\\)\z//)
801 2942 6106 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 125614 26997 unless $name eq "CONTEXT"
896 24386 128225 if ($name eq "EOL")
921 5301 23529 if (ref $value eq 'HASH') { }
929 4705 24125 if ($push->{'name'} eq "EOL")
944 0 61 @$next ? :
947 60 1 if (my $nl = $self->next_line)