Branch Coverage

blib/lib/YAML/PP/Lexer.pm
Criterion Covered Total %
branch 192 260 73.8


line true false branch
7 0 42 $ENV{'YAML_PP_TRACE'} ? :
8 1 41 $ENV{'YAML_PP_DEBUG'} || $ENV{'YAML_PP_TRACE'} ? :
137 706 8834 if (defined $next_line)
142 2796 6038 unless (defined $line)
148 0 6038 unless $line =~ /\A( *)([^\r\n]*)([\r\n]|\z)/
152 29 6009 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 137 7123 if @$next
186 1669 5425 unless ($next_line)
192 67 5358 unless (length $$yaml)
197 61 5297 if (substr($$yaml, 0, 1) eq "#")
202 67 5230 if (not $spaces and substr($$yaml, 0, 1) eq "%")
208 1497 3733 if (not $spaces and $$yaml =~ s/\A(---|\.\.\.)(?=$RE_WS|\z)//) { }
50 3683 elsif ($self->flowcontext and $$yaml =~ /\A[ \t]+(#.*)?\z/) { }
221 1544 3634 unless ($partial)
255 1960 19345 unless (length $$yaml)
263 1451 17894 if ($self->context)
264 1 1450 if ($$yaml =~ s/\A($RE_WS*)://)
265 0 1 if $1
270 0 1450 if ($$yaml =~ s/\A($RE_WS*(?: #.*))\z//)
277 2594 16750 if ($CONTEXT{$first}) { }
4450 12300 elsif ($COLON_DASH_QUESTION{$first}) { }
1935 10365 elsif ($ANCHOR_ALIAS_TAG{$first}) { }
3785 6580 elsif ($first eq ' ' or $first eq "\t") { }
3589 2991 elsif ($FLOW{$first}) { }
284 4329 121 if ($$yaml =~ s/\A\Q$first\E($RE_WS+|\z)//) { }
0 241 elsif ($self->flowcontext and $$yaml =~ s/\A:(?=[,\{\}\[\]])//) { }
286 2 4123 unless ($self->flowcontext or $self->block)
291 11 4316 if ($after =~ tr/\t//)
296 0 4327 unless (defined $1)
302 770 3557 if ($$yaml =~ s/\A(#.*|)\z//)
319 1935 0 if ($$yaml =~ s/\A$REGEX//) { }
329 3785 0 if ($$yaml =~ s/\A($RE_WS+)//)
331 19 3766 if ($$yaml =~ s/\A((?:#.*)?\z)//)
343 1158 2431 if ($first eq '{' or $first eq '[') { }
1157 1274 elsif ($first eq '}' or $first eq ']') { }
354 3112 9290 if ($plain)
371 222 2887 if ($self->flowcontext)
376 2 3107 unless ($$yaml =~ s/\A($REGEX)//)
383 1774 1333 if ($$yaml =~ s/\A(?:($RE_WS+#.*)|($RE_WS*))\z//) { }
384 1 1773 if (defined $1) { }
398 303 1030 unless ($partial)
405 0 1773 if ($self->flowcontext)
413 1086 692 unless ($next_line)
420 5 687 unless (length $$yaml)
427 132 555 if (not $spaces and $$yaml =~ s/\A(---|\.\.\.)(?=$RE_WS|\z)//)
432 555 0 if (length $spaces < $indent)
437 0 0 if ($$yaml =~ s/\A($RE_WS+)//)
440 0 0 unless (length $$yaml)
446 0 0 if ($$yaml =~ s/\A(#.*)\z//)
452 0 0 if ($$yaml =~ s/\A($RE2)//) { }
458 0 0 if ($$yaml =~ s/\A($RE_WS+)//)
461 0 0 unless (length $$yaml)
467 0 0 if ($$yaml =~ s/\A(#.*)\z//) { }
473 0 0 if $ws
480 0 0 if ($self->flowcontext) { }
495 0 1773 if (@lines > 1) { }
498 0 0 if ($tokens[-3] eq "EOL")
508 132 1641 if ($fetch_next)
510 124 8 unless ($partial)
525 0 195 unless $$yaml =~ s/\A\Q$context\E//
531 52 143 if ($$yaml =~ s/\A([1-9])([+-]?)//) { }
61 82 elsif ($$yaml =~ s/\A([+-])([1-9])?//) { }
534 21 31 if $2
535 21 31 if $2
540 0 61 if $2
541 0 61 if $2
543 52 143 if ($set_indent)
545 51 1 if $indent > 0
548 193 2 if (not length $$yaml) { }
0 2 elsif ($$yaml =~ s/\A($RE_WS*(?:$RE_WS#.*|))\z//) { }
563 41 480 unless ($next_line)
569 60 420 if (not $spaces and $content =~ /\A(---|\.\.\.)(?=$RE_WS|\z)/)
572 179 241 if (length $spaces < $current_indent)
573 92 87 if (length $content) { }
574 1 91 if ($content =~ /\A\t/)
586 203 38 if (length $spaces > $current_indent)
587 106 97 if ($started)
592 0 241 unless (length $content)
595 0 0 unless ($started)
600 119 122 unless ($started)
625 0 2399 unless $$yaml =~ s/\A\Q$context\E//
632 118 2399 unless ($start)
633 0 118 unless ($next_line = $self->_fetch_next_line)
636 0 0 if (ref $token)
647 0 118 if (not length $$yaml) { }
0 118 elsif (not $spaces and $$yaml =~ /\A(---|\.\.\.)(?=$RE_WS|\z)/) { }
0 118 elsif (length $spaces < $indent) { }
656 0 0 if (ref $token)
666 0 0 if (ref $token)
674 18 100 if ($$yaml =~ s/\A($RE_WS+)//)
682 2399 118 if ($tokens[-3] eq $token_name)
683 2287 112 if ($start) { }
694 1451 948 if $self->flowcontext
695 1812 587 if (length $$yaml) { }
697 778 1034 unless ($partial)
722 1572 945 if ($first eq q[']) { }
724 1572 0 if ($$yaml =~ s/\A($regex)//)
729 0 1572 unless (length $$yaml)
730 0 0 if ($quoted =~ s/($RE_WS+)\z//)
741 2399 118 if ($$yaml =~ s/\A$first//)
742 2287 112 if ($start) { }
751 0 118 if (length $$yaml)
770 1557 1199 if ($$yaml =~ s/\A([^"\\ \t]+)//)
775 528 2228 if ($$yaml =~ s/\A($RE_ESCAPES)//)
777 1 1 defined $4 ? :
77 2 defined $3 ? :
449 79 defined $2 ? :
784 711 2045 if ($$yaml =~ s/\A([ \t]+)//)
786 675 36 if (length $$yaml) { }
796 8 2712 if ($$yaml =~ s/\A(\\)\z//)
801 901 1811 if $last
812 47 20 if ($$yaml =~ s/\A(\s*%YAML[ \t]+([0-9]+\.[0-9]+))//) { }
11 9 elsif ($$yaml =~ s/\A(\s*%TAG[ \t]+(!$RE_NS_WORD_CHAR*!|!)[ \t]+(tag:\S+|!$RE_URI_CHAR+))($RE_WS*)//) { }
9 0 elsif ($$yaml =~ s/\A(\s*\A%(?:\w+).*)//) { }
815 9 38 if ($$yaml =~ s/\A($RE_WS+)//) { }
0 38 elsif (length $$yaml) { }
823 0 47 unless ($version =~ /^1\.[12]$/)
824 0 0 if ($warn eq 'warn') { }
0 0 elsif ($warn eq 'fatal') { }
844 0 9 if ($warn eq 'warn') { }
0 9 elsif ($warn eq 'fatal') { }
857 58 9 if (not length $$yaml) { }
9 0 elsif ($trailing_ws and $$yaml =~ s/\A(#.*)?\z//) { }
0 0 elsif ($$yaml =~ s/\A([ \t]+#.*)?\z//) { }
894 31220 5706 unless $name eq "CONTEXT"
896 5553 31373 if ($name eq "EOL")
921 2517 6169 if (ref $value eq 'HASH') { }
929 446 8240 if ($push->{'name'} eq "EOL")
944 0 36 @$next ? :
947 36 0 if (my $nl = $self->next_line)