Branch Coverage

blib/lib/Parse/Earley.pm
Criterion Covered Total %
branch 58 114 50.8


line true false branch
43 150 31 unless (grep {$_ == $state;} @{$$self{'sets'}{$$state{'pos'}};})
78 1 124 if ($noskip_f)
86 18 107 if (/^(\w+)\s*:$/) { }
6 101 elsif (/^\|$/) { }
24 77 elsif (/^(\w+)$/) { }
7 70 elsif (/^['"]/) { }
0 70 elsif (/^q/) { }
5 65 elsif (m[^/(.*)/$] or /^m.(.*).$/) { }
1 64 elsif (/^<\s*(.*)\s*>$/) { }
0 64 elsif (/^{/) { }
64 0 elsif (/^#/ or /^\s*$/) { }
117 1 0 if ($dir eq 'noskip') { }
125 0 0 if ($$self{'no_code'}) { }
0 0 elsif (@rulebuf) { }
130 0 0 if $@
143 0 6 if ($errors) { }
182 96 78 if ($p) { }
183 43 53 if ($$p{'type'} eq 'nonterminal') { }
195 0 52 if ($DEBUG)
199 0 0 /nc/ ? :
204 0 0 if ($$state{'pos'} < $displen) { }
211 0 0 ord $1 < 32 || ord $1 > 127 ? :
215 0 0 if ($$state{'dot'} == $i)
218 0 0 if (exists $$state{'rule'}[$i])
221 0 0 if ($t eq 'literal') { }
0 0 elsif ($t eq 'regex') { }
250 1 6 unless my $cset = $$self{'sets'}{length $str}
252 6 20 if $$_{'lhs'} eq $rule and $$_{'dot'} == @{$$_{'rule'};}
261 6 0 unless (@$cset)
270 0 1 if ($self->matches($str, $rule)) { }
274 0 1 @{$$self{'set'};} ? :
284 0 43 unless ($$self{'rules'}{$$p{'match'}})
290 19 2 if $$_{'rule'} == $m and $$_{'lhs'} eq $$p{'match'} and $$_{'dot'} == 0 and $$_{'pos'} == $$state{'pos'}
43 19 if (not grep({$$_{'ref'} == $$state{'pos'} if $$_{'rule'} == $m and $$_{'lhs'} eq $$p{'match'} and $$_{'dot'} == 0 and $$_{'pos'} == $$state{'pos'};} @$cset)) { }
317 47 6 unless ($$state{'rule'}[$$state{'dot'}]{'noskip'})
323 29 24 if ($$p{'type'} eq 'literal') { }
24 0 elsif ($$p{'type'} eq 'regex') { }
326 0 29 if ($$p{'code'})
329 0 0 if $@
331 19 10 if ($res and $tok eq $$p{'match'})
340 0 0 if $$_{'rule'} == $$push{'rule'} and $$_{'lhs'} eq $$push{'lhs'} and $$_{'dot'} == $$push{'dot'} and $$_{'pos'} == $$push{'pos'}
19 0 unless (grep {$$_{'ref'} == $$push{'ref'} if $$_{'rule'} == $$push{'rule'} and $$_{'lhs'} eq $$push{'lhs'} and $$_{'dot'} == $$push{'dot'} and $$_{'pos'} == $$push{'pos'};} @{$$self{'ncset'};})
353 24 0 if ($str =~ /\G($$p{'match'})/g)
355 0 24 if ($$p{'code'})
358 0 0 if $@
359 0 0 unless $res
369 0 0 if $$_{'rule'} == $$push{'rule'} and $$_{'lhs'} eq $$push{'lhs'} and $$_{'dot'} == $$push{'dot'} and $$_{'pos'} == $$push{'pos'}
24 0 unless (grep {$$_{'ref'} == $$push{'ref'} if $$_{'rule'} == $$push{'rule'} and $$_{'lhs'} eq $$push{'lhs'} and $$_{'dot'} == $$push{'dot'} and $$_{'pos'} == $$push{'pos'};} @{$$self{'ncset'};})
394 3 19 if $$_{'rule'} == $$m{'rule'} and $$_{'lhs'} eq $$m{'lhs'} and $$_{'dot'} == $$m{'dot'} + 1 and $$_{'pos'} == $$state{'pos'}
81 2 if (not @g = grep({$$_{'ref'} == $$m{'ref'} if $$_{'rule'} == $$m{'rule'} and $$_{'lhs'} eq $$m{'lhs'} and $$_{'dot'} == $$m{'dot'} + 1 and $$_{'pos'} == $$state{'pos'};} @$cset)) { }
408 0 81 if ($$m{'rule'}[$$m{'dot'}]{'code'}) { }
411 0 0 if $@
413 0 0 $res ? :
421 2 0 unless (grep {$_ == $state;} @{$$_{'down'};} and grep {$_ == $m;} @{$$_{'left'};})
424 0 2 if ($$m{'rule'}[$$m{'dot'}]{'code'})
428 0 0 if $@
431 2 0 if ($succ)