Branch Coverage

inc/Pegex/Optimizer.pm
Criterion Covered Total %
branch 33 52 63.4


line true false branch
11 1 13 if $$tree{'+optimized'}
12 0 13 if $self->parser->{'maxparse'}
15 40 560 unless ref $node
30 7 1298 defined $max ? :
1305 92 unless defined $$node{'+min'}
32 92 1298 defined $min ? :
1390 7 unless defined $$node{'+max'}
34 1347 50 unless defined $$node{'+asr'}
38 0 2318 if $kind eq 'xxx'
39 1397 921 if ($$node{'rule'} = $$node{".$kind"})
42 760 637 if ($kind eq 'ref')
43 0 760 unless my $rule = $$node{'rule'}
44 0 760 if (my $method = $self->grammar->can("rule_$rule")) { }
0 760 elsif (not $self->grammar->{'tree'}{$rule}) { }
48 0 0 if (my $method = $self->grammar->can("$rule"))
60 0 1397 unless $$node{'method'} ||= $self->parser->can("match_$kind")
65 201 1196 if ($$node{'kind'} =~ /^(?:all|any)$/) { }
760 436 elsif ($$node{'kind'} eq 'ref') { }
436 0 elsif ($$node{'kind'} eq 'rgx') { }
72 400 360 if (my $action = $self->receiver->can("got_$ref")) { }
360 0 elsif (my $gotrule = $self->receiver->can('gotrule')) { }
78 0 760 if ($self->parser->{'debug'})
106 0 0 $asr == 1 ? :
0 0 $asr == -1 ? :
112 0 0 if ($result = $self->$method($ref, $parent)) { }
130 0 0 if $counter++ >= $maxparse