Branch Coverage

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


line true false branch
11 2 2 if $$tree{'+optimized'}
12 0 2 if $self->parser->{'maxparse'}
15 8 112 unless ref $node
30 14 268 defined $max ? :
282 16 unless defined $$node{'+min'}
32 16 268 defined $min ? :
284 14 unless defined $$node{'+max'}
34 294 4 unless defined $$node{'+asr'}
38 0 532 if $kind eq 'xxx'
39 298 234 if ($$node{'rule'} = $$node{".$kind"})
42 152 146 if ($kind eq 'ref')
43 0 152 unless my $rule = $$node{'rule'}
44 0 152 if (my $method = $self->grammar->can("rule_$rule")) { }
0 152 elsif (not $self->grammar->{'tree'}{$rule}) { }
48 0 0 if (my $method = $self->grammar->can("$rule"))
60 0 298 unless $$node{'method'} ||= $self->parser->can("match_$kind")
65 66 232 if ($$node{'kind'} =~ /^(?:all|any)$/) { }
152 80 elsif ($$node{'kind'} eq 'ref') { }
80 0 elsif ($$node{'kind'} eq 'rgx') { }
72 56 96 if (my $action = $self->receiver->can("got_$ref")) { }
96 0 elsif (my $gotrule = $self->receiver->can('gotrule')) { }
78 0 152 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