Branch Coverage

blib/lib/Parser/MGC.pm
Criterion Covered Total %
branch 103 116 88.7


line true false branch
202 0 48 unless $class->can($toplevel)
214 1 47 if ($args{'accept_0o_oct'})
218 1 47 if (defined $self->{'patterns'}{'comment'}) { }
276 2 167 if (my $code = $self->can("on_parse_start"))
283 5 144 unless $self->at_eos
286 2 142 if (my $code = $self->can("on_parse_end"))
320 0 3 unless defined $file
325 2 1 if (ref $file) { }
329 0 1 unless open $fh, "<", $file
332 0 3 if $opts{'binmode'}
390 0 1 unless $self->at_eos
454 13 70 unless defined $pos
459 3 80 if $sol > 0 and substr($str, $sol, 1) =~ /^[\r\n]$/u
607 178 464 if (pos $self->{'str'} >= length $self->{'str'}) { }
114 350 elsif (defined $self->{'endofscope'}) { }
768 1 1 if $committed or not _isa_failure($e)
823 73 0 unless ref $stop
825 65 8 if defined $start
827 16 18 if $commit_if_started
896 16 67 if defined $sep
910 1 156 if (@lastpos > $self->{'stallcount'})
912 1 0 if $lastpos[0] == $pos
921 1 23 if $committed or not _isa_failure($e)
927 32 100 if (defined $sep)
929 15 17 unless $self->{'str'} =~ /\G$sep/cgu
1040 3 238 if $committed or not _isa_failure($e)
1086 69 0 if ($self->{'committer'}) { }
1110 1127 238 if pos $self->{'str'} < length $self->{'str'}
1112 234 4 unless $self->{'reader'}
1115 3 1 if (defined $more)
1166 11 393 unless ref $expect
1169 172 232 unless $self->{'str'} =~ /\G$expect/cgu
1171 192 40 unless wantarray
1172 59 1 defined $-[$_] ? :
1180 273 115 unless ref $expect
1182 60 328 if (wantarray) { }
1183 22 38 unless my(@ret) = $self->maybe_expect($expect)
1188 139 189 unless defined(my $ret = $self->maybe_expect($expect))
1271 42 10 unless ref $expect
1273 4 48 defined $self->{'endofscope'} ? :
1281 42 10 if ($self->{'str'} =~ /\G(?s:.*?)($endre)/u) { }
1288 1 51 if $fail_if_empty and $end == $start
1340 0 230 if $self->at_eos
1343 61 169 unless $self->{'str'} =~ /\G$re/cgu
1348 123 46 $convert ? :
1357 226 0 $args{'pattern'} ? :
1381 1 103 $int =~ s/^-//u ? :
1385 5 99 if $int =~ /^0/u
1475 1 52 if $self->at_eos
1480 20 32 unless $self->{'str'} =~ /\G($self->{'patterns'}{'string_delim'})/cgu
1495 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
1503 7 0 exists $escapes{$4} ? :
1 7 defined $3 ? :
1 8 defined $2 ? :
2 9 if (defined $1) { }
1544 0 2 unless defined(my $kw = $self->token_ident)
1548 1 1 unless grep {$_ eq $kw;} @acceptable
1580 2 68 defined $filename && !ref($filename) ? :