Branch Coverage

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


line true false branch
11 1 1 if $$tree{'+optimized'}
12 0 1 if $self->parser->{'maxparse'}
15 4 56 unless ref $node
30 7 134 defined $max ? :
141 8 unless defined $$node{'+min'}
32 8 134 defined $min ? :
142 7 unless defined $$node{'+max'}
34 147 2 unless defined $$node{'+asr'}
38 0 266 if $kind eq 'xxx'
39 149 117 if ($$node{'rule'} = $$node{".$kind"})
42 76 73 if ($kind eq 'ref')
43 0 76 unless my $rule = $$node{'rule'}
44 0 76 if (my $method = $self->grammar->can("rule_$rule")) { }
0 76 elsif (not $self->grammar->{'tree'}{$rule}) { }
48 0 0 if (my $method = $self->grammar->can("$rule"))
60 0 149 unless $$node{'method'} ||= $self->parser->can("match_$kind")
65 33 116 if ($$node{'kind'} =~ /^(?:all|any)$/) { }
76 40 elsif ($$node{'kind'} eq 'ref') { }
40 0 elsif ($$node{'kind'} eq 'rgx') { }
72 28 48 if (my $action = $self->receiver->can("got_$ref")) { }
48 0 elsif (my $gotrule = $self->receiver->can('gotrule')) { }
78 0 76 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