Branch Coverage

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


line true false branch
24 0 36 unless 'Parse::Eyapp::Driver'->can('YYParse')
25 0 36 unless 'Parse::Eyapp::Node'->can('hnew')
29 0 0 defined pos $_ ? :
0 0 defined $_ ? :
71 10 72 $semantic ? :
83 4 7 if ($_[2]->children) { }
97 0 11 $semantic ? :
108 0 2 if $times{$var} > 1
109 0 2 if $var eq 'W'
114 0 2 $semantic ? :
129 0 1 $semantic ? :
140 4 20 $semantic ? :
151 0 1 if ($_[2]->children) { }
160 0 1 $semantic ? :
176 0 50 if $times{$var} > 1
177 0 50 if $var eq 'W'
180 0 50 $semantic ? :
195 0 23 $semantic ? :
210 0 33 if $times{$var} > 2
211 0 33 if $var =~ /^W(_\d+)?$/
242 0 27 if ref $class
244 0 27 unless 'Parse::Eyapp::Treeregparser'->isa('Parse::Eyapp::Driver')
903 0 51 if $debug
1178 35 127 if ($_->isa('Parse::Eyapp::Treeregexp::ARRAY_TERMINAL'))
1181 16 19 if (defined $r)
1182 0 16 if $r->isa('Parse::Eyapp::Treeregexp::ARRAY_TERMINAL')
1277 0 788 unless defined $input
1285 383 405 if ($input =~ m[\G((?: \s+ # any white space char | \#[^\n]* # Perl like comments | /\*.*?\*/ # C like comments )+)]cgsx)
1289 27 356 if pos $input >= length $input
1296 14 747 if $input =~ /\G(and)/cg
1300 172 575 if ($input =~ /\G([A-Za-z_][A-Za-z0-9_]*)/cg)
1305 52 523 if ($input =~ /\G(\$[A-Za-z_][A-Za-z0-9_]*)/cg)
1310 33 490 if ($input =~ /\G(\@[A-Za-z_][A-Za-z0-9_]*)/cg)
1321 12 478 if ($input =~ m(\G/( (?:[^/\\]| # no escape or slash \\\\| # escaped escape \\/| # escaped slash \\ # escape )+? ) /([Begiomxsc]*))cgx)
1324 1 11 $2 ? :
1329 12 0 unless $options =~ s/B//
1334 12 0 unless $options =~ /x/ or $options =~ s/X//
1339 0 478 if ($input =~ /\G%{/cg)
1342 0 0 unless $input =~ /\G(.*?)%}/cgs
1351 70 408 if ($input =~ /\G{/cg)
1358 0 272 if substr($input, pos($input) - 1, 1) eq '\\'
1360 101 171 $1 eq '{' ? :
70 202 unless $level += $1 eq '{' ? 1 : -1
1364 0 70 if $level
1370 47 361 if $input =~ /\G(=>)/cg
1375 361 0 if ($input =~ /\G(.)/gs)
1376 0 361 if $1 eq "\n"
1386 0 0 unless defined $value and ref $value eq 'ARRAY'
1395 0 0 $lineno < 0 ? :
1422 40 169 if ($times{$var} > 1) { }
1464 0 30 if @_ % 2
1467 0 30 if (defined($a = invalid_keys(\%_Trnew, \%arg)))
1472 0 30 if exists $arg{'SYNTAX'}
1484 2 28 defined $arg{'NUMBERS'} ? :
1490 0 30 if (defined $filename) { }
30 0 elsif (defined $input) { }
1492 0 0 if defined $input
1499 28 2 unless defined $packagename and $packagename =~ /(?:[A-Za-z_][A-Za-z0-9_]*::)*[A-Za-z_][A-Za-z0-9_]*/
1507 0 30 unless defined $packagename
1508 8 22 if exists $arg{'FIRSTLINE'} and $arg{'FIRSTLINE'} =~ /^\s*\d+/
1510 0 30 unless $packagename =~ /^(?:[A-Za-z_][A-Za-z0-9_]*::)* # Perl identifier: prefix (?:[A-Za-z_][A-Za-z0-9_]*)$/x
1553 133 96 if ref($treereg) =~ /TERMINAL$/ or $is_array
1565 146 16 unless $is_array
1567 10 86 if (my $pat = $$treereg{'semantic'})
1584 0 27 unless $self->isa('Parse::Eyapp::Treeregexp')
1600 9 54 if ($transform->isa('Parse::Eyapp::Treeregexp::GLOBALCODE'))
1606 3 51 if ($transform->isa('Parse::Eyapp::Treeregexp::FAMILY'))
1630 0 27 if ($input_from_file or defined $outputfile) { }
1631 0 0 if $$self{'NUMBERS'}
1633 0 0 if ($$self{'CHECKSYNTAX'})
1639 0 27 if $debug
1640 27 0 if ($$self{'CHECKSYNTAX'})
1642 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'
1692 0 8 unless $names =~ /\b$_\b/
1700 16 213 if has_array_prefix($self)
1709 59 14 if $allowlinenumbers
1728 16 0 unless defined $line
1749 14 0 if (defined $pat) { }
1768 47 4 if ($action) { }
1783 51 0 unless defined $line
1808 154 55 if $times{$_} == 1
1863 4 103 if $pat
1959 99 4 unless $severity