Branch Coverage

blib/lib/Parser/MGC.pm
Criterion Covered Total %
branch 99 112 88.3


line true false branch
200 0 48 unless $class->can($toplevel)
212 1 47 if ($args{'accept_0o_oct'})
216 1 47 if (defined $self->{'patterns'}{'comment'}) { }
274 2 165 if (my $code = $self->can("on_parse_start"))
281 5 143 unless $self->at_eos
284 2 141 if (my $code = $self->can("on_parse_end"))
318 0 3 unless defined $file
323 2 1 if (ref $file) { }
327 0 1 unless open $fh, "<", $file
330 0 3 if $opts{'binmode'}
388 0 1 unless $self->at_eos
452 7 44 unless defined $pos
457 1 50 if $sol > 0 and substr($str, $sol, 1) =~ /^[\r\n]$/u
512 262 2 if &Scalar::Util::blessed($_[0])
572 177 464 if (pos $self->{'str'} >= length $self->{'str'}) { }
114 350 elsif (defined $self->{'endofscope'}) { }
783 73 0 unless ref $stop
785 65 8 if defined $start
787 16 18 if $commit_if_started
856 16 67 if defined $sep
870 1 156 if (@lastpos > $self->{'stallcount'})
872 1 0 if $lastpos[0] == $pos
887 32 100 if (defined $sep)
889 15 17 unless $self->{'str'} =~ /\G$sep/cgu
1042 69 0 if ($self->{'committer'}) { }
1066 1123 237 if pos $self->{'str'} < length $self->{'str'}
1068 233 4 unless $self->{'reader'}
1071 3 1 if (defined $more)
1122 11 389 unless ref $expect
1125 172 228 unless $self->{'str'} =~ /\G$expect/cgu
1127 188 40 unless wantarray
1128 59 1 defined $-[$_] ? :
1136 271 113 unless ref $expect
1138 60 324 if (wantarray) { }
1139 22 38 unless my(@ret) = $self->maybe_expect($expect)
1144 139 185 unless defined(my $ret = $self->maybe_expect($expect))
1227 42 10 unless ref $expect
1229 4 48 defined $self->{'endofscope'} ? :
1237 42 10 if ($self->{'str'} =~ /\G(?s:.*?)($endre)/u) { }
1244 1 51 if $fail_if_empty and $end == $start
1296 0 230 if $self->at_eos
1299 61 169 unless $self->{'str'} =~ /\G$re/cgu
1304 123 46 $convert ? :
1313 226 0 $args{'pattern'} ? :
1337 1 103 $int =~ s/^-//u ? :
1341 5 99 if $int =~ /^0/u
1427 1 52 if $self->at_eos
1432 20 32 unless $self->{'str'} =~ /\G($self->{'patterns'}{'string_delim'})/cgu
1447 0 32 unless $self->{'str'} =~ / \G( (?: \\[0-7]{1,3} # octal escape |\\x[0-9A-F]{2} # 2-digit hex escape |\\x\{[0-9A-F]+\} # {}-delimited hex escape |\\. # symbolic escape |[^\\$delim]+ # plain chunk )*? )$delim/cgiux
1454 7 0 exists $escapes{$4} ? :
1 7 defined $3 ? :
1 8 defined $2 ? :
2 9 defined $1 ? :
1495 0 2 unless defined(my $kw = $self->token_ident)
1499 1 1 unless grep {$_ eq $kw;} @acceptable
1531 2 42 defined $filename && !ref($filename) ? :