Branch Coverage

blib/lib/Parse/Eyapp/Treeregexp.pm
Criterion Covered Total %
branch 136 208 65.3


line true false branch
30 0 36 unless 'Parse::Eyapp::Driver'->can('YYParse')
31 0 36 unless 'Parse::Eyapp::Node'->can('hnew')
35 0 0 defined pos $_ ? :
0 0 defined $_ ? :
77 10 72 $semantic ? :
89 4 7 if ($_[2]->children) { }
103 0 11 $semantic ? :
114 0 2 if $times{$var} > 1
115 0 2 if $var eq 'W'
120 0 2 $semantic ? :
135 0 1 $semantic ? :
146 4 20 $semantic ? :
157 0 1 if ($_[2]->children) { }
166 0 1 $semantic ? :
182 0 50 if $times{$var} > 1
183 0 50 if $var eq 'W'
186 0 50 $semantic ? :
201 0 23 $semantic ? :
216 0 33 if $times{$var} > 2
217 0 33 if $var =~ /^W(_\d+)?$/
279 0 27 if ref $class
281 0 27 unless 'Parse::Eyapp::Treeregparser'->isa('Parse::Eyapp::Driver')
1005 0 51 if $debug
1280 35 127 if ($_->isa('Parse::Eyapp::Treeregexp::ARRAY_TERMINAL'))
1283 16 19 if (defined $r)
1284 0 16 if $r->isa('Parse::Eyapp::Treeregexp::ARRAY_TERMINAL')
1379 0 788 unless defined $input
1387 383 405 if ($input =~ m[\G((?: \s+ # any white space char | \#[^\n]* # Perl like comments | /\*.*?\*/ # C like comments )+)]cgsx)
1391 27 356 if pos $input >= length $input
1398 14 747 if $input =~ /\G(and)/cg
1402 172 575 if ($input =~ /\G([A-Za-z_][A-Za-z0-9_]*)/cg)
1407 52 523 if ($input =~ /\G(\$[A-Za-z_][A-Za-z0-9_]*)/cg)
1412 33 490 if ($input =~ /\G(\@[A-Za-z_][A-Za-z0-9_]*)/cg)
1423 12 478 if ($input =~ m(\G/( (?:[^/\\]| # no escape or slash \\\\| # escaped escape \\/| # escaped slash \\ # escape )+? ) /([Begiomxsc]*))cgx)
1426 1 11 $2 ? :
1431 12 0 unless $options =~ s/B//
1436 12 0 unless $options =~ /x/ or $options =~ s/X//
1441 0 478 if ($input =~ /\G%\{/cg)
1444 0 0 unless $input =~ /\G(.*?)%}/cgs
1453 70 408 if ($input =~ /\G\{/cg)
1460 0 272 if substr($input, pos($input) - 1, 1) eq '\\'
1462 101 171 $1 eq '{' ? :
70 202 unless $level += $1 eq '{' ? 1 : -1
1466 0 70 if $level
1472 47 361 if $input =~ /\G(=>)/cg
1477 361 0 if ($input =~ /\G(.)/gs)
1478 0 361 if $1 eq "\n"
1488 0 0 unless defined $value and ref $value eq 'ARRAY'
1497 0 0 $lineno < 0 ? :
1524 40 169 if ($times{$var} > 1) { }
1566 0 30 if @_ % 2
1569 0 30 if (defined($a = invalid_keys(\%_Trnew, \%arg)))
1574 0 30 if exists $arg{'SYNTAX'}
1586 2 28 defined $arg{'NUMBERS'} ? :
1592 0 30 if (defined $filename) { }
30 0 elsif (defined $input) { }
1594 0 0 if defined $input
1601 28 2 unless defined $packagename and $packagename =~ /(?:[A-Za-z_][A-Za-z0-9_]*::)*[A-Za-z_][A-Za-z0-9_]*/
1609 0 30 unless defined $packagename
1610 8 22 if exists $arg{'FIRSTLINE'} and $arg{'FIRSTLINE'} =~ /^\s*\d+/
1612 0 30 unless $packagename =~ /^(?:[A-Za-z_][A-Za-z0-9_]*::)* # Perl identifier: prefix (?:[A-Za-z_][A-Za-z0-9_]*)$/x
1655 133 96 if ref($treereg) =~ /TERMINAL$/ or $is_array
1667 146 16 unless $is_array
1669 10 86 if (my $pat = $treereg->{'semantic'})
1686 0 27 unless $self->isa('Parse::Eyapp::Treeregexp')
1702 9 54 if ($transform->isa('Parse::Eyapp::Treeregexp::GLOBALCODE'))
1708 3 51 if ($transform->isa('Parse::Eyapp::Treeregexp::FAMILY'))
1732 0 27 if ($input_from_file or defined $outputfile) { }
1733 0 0 if $self->{'NUMBERS'}
1735 0 0 if ($self->{'CHECKSYNTAX'})
1741 0 27 if $debug
1742 27 0 if ($self->{'CHECKSYNTAX'})
1744 0 27 unless eval $text
521 170 unless ref($CODE = $_[$child_index]) eq 'CODE'
90 47 unless ref($B = $_[$child_index]) eq 'B'
12 21 unless ref($ABC = $_[$child_index]) eq 'ABC'
24 24 unless until_first_match($ABC, 0, $a, \@a)
53 12 unless defined($x = $_[$child_index])
0 10 unless until_first_match($x, 0, $a, \@a)
2 8 unless ref($WHILE = $_[$child_index]) eq 'WHILE'
0 4 unless ref($VAR = $WHILE->child(0 + $child_index)) eq 'VAR'
0 4 unless defined($b = $VAR->child(0 + $child_index))
1 0 unless ref($BLOCK = $WHILE->child(1 + $child_index)) eq 'BLOCK'
33 2 unless until_first_match($BLOCK, 0, $a, \@a)
0 2 unless ref($W = $_[$child_index]) =~ /\bTIMES\b|\bPLUS\b|\bDIV\b|\bMINUS\b/xi
0 2 unless defined($n = $W->child(0 + $child_index))
0 2 unless defined($m = $W->child(1 + $child_index))
49 5 unless ref($TIMES = $_[$child_index]) eq 'TIMES'
52 3 unless ref($NUM = $TIMES->child(0 + $child_index)) eq 'NUM'
1 2 unless defined($x = $NUM->child(0 + $child_index))
0 2 unless defined($W = $TIMES->child(1 + $child_index))
2 0 unless ref($TIMES = $_[$child_index]) eq 'TIMES'
0 0 unless ref($DIV = $TIMES->child(0 + $child_index)) eq 'DIV'
0 0 unless ref($NUM[0] = $DIV->child(0 + $child_index)) eq 'NUM'
1794 0 8 unless $names =~ /\b$_\b/
1802 16 213 if has_array_prefix($self)
1811 59 14 if $allowlinenumbers
1830 16 0 unless defined $line
1851 14 0 if (defined $pat) { }
1870 47 4 if ($action) { }
1885 51 0 unless defined $line
1910 154 55 if $times{$_} == 1
1971 4 103 if $pat
2067 99 4 unless $severity