Branch Coverage

blib/lib/Regexp/Grammars.pm
Criterion Covered Total %
branch 265 454 58.3


line true false branch
40 177 102 if (_module_is_active() and $type =~ /qq?/) { }
51 94 0 if ($] >= "5.018")
53 0 94 if ($] < "5.018004")
105 97 0 if (ref $x)
106 38 59 if (ref $y)
107 21 76 if ($reversed)
163 0 0 if (defined wantarray)
230 0 0 if ($field_width > $MAX_CONTEXT_WIDTH) { }
0 0 elsif ($field_width < $MIN_CONTEXT_WIDTH) { }
243 0 0 if ($fill_chars) { }
245 0 0 length $fill_chars > 1 ? :
253 0 0 if ($context_str eq "")
258 0 0 if ($context_str eq $last_context_str) { }
274 0 2 @_ == 1 ? :
282 0 2 if (not $severity =~ /\S/) { }
0 2 elsif ($severity eq 'info' and $prev_severity eq 'info') { }
308 0 0 if (-t *LOGFILE and defined $DEBUG and ($DEBUG_LEVEL{$DEBUG} // 0) >= $DEBUG_LEVEL{$min_debug_level}) { }
319 0 0 if ($cmd eq 'd') { }
321 0 0 $stack_height ? :
329 0 0 if (defined $DEBUG_LEVEL{$cmd})
354 0 0 if $in_match and $error_ref->{'height'} == $stack_height and $error_ref->{'subrule'} eq $subrule
378 333 1 if &reftype($obj) eq "HASH"
415 0 0 if ($backtrack_distance > 0)
416 0 0 $backtrack_distance > 1 ? :
431 0 0 if ($subrule ne "next alternative")
453 0 0 $stack_height ? :
455 0 0 $stack_height ? :
463 0 0 if ($backtrack_distance > 0)
464 0 0 $backtrack_distance > 1 ? :
474 0 0 defined $matched_text ? :
482 0 0 $stack_height ? :
492 0 0 $stack_height ? :
495 0 0 $stack_height ? :
0 0 $succeeded ? :
503 0 0 if ($backtrack_distance > 0)
504 0 0 $backtrack_distance > 1 ? :
545 422 1 unless $debugging_active
562 1824 0 unless $debugging_active
566 0 0 if ($subpattern eq '|') { }
592 0 0 if time < $Regexp::Grammars::TIMEOUT->{'limit'}
595 0 0 $Regexp::Grammars::TIMEOUT->{'duration'} == 1 ? :
597 0 0 if (defined $DEBUG and $DEBUG ne "off")
606 0 0 unless (@!)
620 0 2011 unless (@{$stack_ref;})
631 0 2011 if (my $class = &blessed($stack_ref->[-1]))
653 0 131 if (my $class = &blessed($stack_ref->[-1]))
683 0 102 keys %{$curr_frame;} ? :
545 102 $is_blessed_curr || length join('', keys %{$curr_frame;}) ? :
173 647 exists $curr_frame->{'='} ? :
688 88 732 if ($RULE_HANDLER)
689 22 66 if ($RULE_HANDLER->can($original_name) or $RULE_HANDLER->can("AUTOLOAD"))
692 22 0 if (defined $replacement_result_frame)
699 28 83 if ($nocontext and ref $cloned_result_frame eq "HASH" and keys %{$cloned_result_frame;} > 1)
710 213 607 if ($is_blessed_curr and not exists $curr_frame->{'='})
713 0 820 if ($is_blessed_caller)
744 0 951 keys %{$curr_frame;} ? :
233 951 $is_blessed_curr || length join('', keys %{$curr_frame;}) ? :
218 1184 exists $curr_frame->{'='} ? :
749 174 1228 if ($RULE_HANDLER)
750 106 68 if ($RULE_HANDLER->can($original_name) or $RULE_HANDLER->can("AUTOLOAD"))
753 106 0 if (defined $replacement_result_frame)
760 82 10 if ($nocontext and ref $cloned_result_frame eq "HASH" and keys %{$cloned_result_frame;} > 1)
774 120 1282 if ($is_blessed_curr and not exists $curr_frame->{'='})
777 0 1402 if ($is_blessed_caller)
868 86 0 if defined $_
914 0 1 if ref $translator_ref ne "CODE"
921 1 0 defined wantarray ? :
955 0 0 if ($debug_build and $visible_regex ne "" and $visible_regex ne " ")
956 0 0 $is_comment ? :
965 2 1824 if $is_comment
978 0 1824 $debug_runtime && $regex =~ /\S/ ? :
0 1824 $debug_runtime && $regex eq '|' ? :
992 0 0 if ($debug_build)
1008 0 0 if ($debug_build)
1009 0 0 $timeout == 1 ? :
0 0 $timeout > 0 ? :
1019 0 0 $timeout > 0 ? :
1031 0 0 if ($debug_build)
1058 0 3 if ($debug_build)
1085 11 8 $type eq 'error' ? :
1088 2 17 $type eq 'fatal' ? :
1091 4 15 if (substr($msg, 0, 3) eq '(?{') { }
1100 0 19 if ($debug_build)
1101 0 0 $type eq 'log' ? :
1110 11 8 $severity eq 'fail' ? :
0 19 $type eq 'log' ? :
1135 21 89 $is_codeblock ? :
1136 21 89 $is_codeblock ? :
1137 21 89 $is_codeblock ? :
1138 10 79 defined $backref ? :
21 89 $is_codeblock ? :
1141 21 89 $is_codeblock ? :
1148 0 110 $postmodifier && !$is_noncapturing ? :
0 110 substr($postmodifier, 0, 1) eq '?' ? :
0 110 $is_listifying && $postmodifier ? :
1153 0 110 if ($debug_build)
1154 0 0 $is_listifying ? :
0 0 $is_noncapturing ? :
1170 6 104 $is_noncapturing ? :
1181 0 110 $timeout ? :
1193 8 6 if (not defined $keypat && $keypat =~ /\S/) { }
1209 0 11 $postmodifier && !$is_noncapturing ? :
0 11 substr($postmodifier, 0, 1) eq '?' ? :
3 11 $is_listifying && $postmodifier ? :
1214 0 14 if ($debug_build)
1215 0 0 $is_listifying ? :
0 0 $is_noncapturing ? :
1231 4 10 $is_noncapturing ? :
1242 0 14 $timeout ? :
1259 70 3 length $ws ? :
1262 17 56 substr($op, -2) eq '%%' ? :
1266 0 73 $timeout ? :
1269 0 73 if ($debug_build)
1270 0 0 substr($op, -2) eq '%%' ? :
1283 51 22 if $op =~ / [*][*]() | [+]([+?]?) \s* %%?+ | \{ 1, \}([+?]?) \s* %%?+ /msx
1288 4 18 if $op =~ / [*]([+?]?) \s* %%? | \{ 0, \}([+?]?) \s* %%? /msx
1292 4 14 if $op =~ / [?]([+?]?) \s* %%? | \{ 0,1 \}([+?]?) \s* %%? /msx
1296 2 12 if $op =~ / \{ 0 \}[+?]? \s* %%? /msx
1300 2 10 if ($op =~ / \{ (\d+) \}([+?]?) \s* %%? /msx)
1307 2 8 if ($op =~ / \{ 0,(\d+) \}([+?]?) \s* %%? /msx)
1314 8 0 if ($op =~ / \{ (\d+),(\d*) \} ([+?]?) \s* %%? /msx)
1316 6 2 $2 ? :
1332 289 10 if ($args eq '') { }
1 9 elsif (substr($args, 0, 3) eq '(?{') { }
1348 3 296 $simple_subrule =~ s/(.*):://msx ? :
1349 297 2 unless ($start_grammar =~ /^NEXT$|::/)
1353 1 298 $start_grammar eq 'NEXT' ? :
1360 3 299 if ($CACHE{$inherited_subrule})
1371 0 299 unless ($valid_subrule_names_ref->{$subrule})
1386 92 197 $is_listifying ? :
10 289 $is_noncapturing ? :
1405 10 281 substr($postmodifier, 0, 1) eq '?' ? :
8 291 $is_listifying && $postmodifier ? :
1409 1 297 $savemode eq 'poslookahead' ? :
1 298 $savemode eq 'neglookahead' ? :
1413 0 299 if ($debug_build)
1414 0 0 defined $arg_desc ? :
0 0 $is_listifying ? :
0 0 $is_noncapturing ? :
1433 0 299 $timeout ? :
1451 39 221 $objectify ? :
1461 6 254 $callname eq 'ws' || $callname eq 'hk' ? :
1496 135 125 $magic_ws ? :
260 129 $rule_name ? :
1684 2138 137 ($+{'alias'} // 'MATCH') eq 'MATCH' ? :
1690 84 2191 if (defined $+{'alias_parens_scalar'}) { }
0 2191 elsif (defined $+{'alias_parens_scalar_nocap'}) { }
16 2175 elsif (defined $+{'alias_parens_list'}) { }
7 2168 elsif (defined $+{'alias_hash_scalar'}) { }
4 2164 elsif (defined $+{'alias_hash_scalar_nocap'}) { }
3 2161 elsif (defined $+{'alias_hash_list'}) { }
22 2139 elsif (defined $+{'alias_subrule_scalar'}) { }
30 2109 elsif (defined $+{'alias_subrule_list'}) { }
2 2107 elsif (defined $+{'self_subrule_lookahead'}) { }
8 2099 elsif (defined $+{'self_subrule_scalar_nocap'}) { }
175 1924 elsif (defined $+{'self_subrule_scalar'}) { }
62 1862 elsif (defined $+{'self_subrule_list'}) { }
0 1862 elsif (defined $+{'alias_argrule_scalar'}) { }
0 1862 elsif (defined $+{'alias_argrule_list'}) { }
1 1861 elsif (defined $+{'self_argrule_scalar'}) { }
9 1852 elsif (defined $+{'backref'} or $+{'alias_backref'} or $+{'alias_backref_list'}) { }
481 1371 elsif (defined $+{'reportable_raw_regex'}) { }
0 1371 elsif (defined $+{'complex_repetition'}) { }
1345 26 elsif (defined $+{'raw_regex'}) { }
0 26 elsif (defined $+{'require_directive'}) { }
3 23 elsif (defined $+{'minimize_directive'}) { }
0 23 elsif (defined $+{'debug_directive'}) { }
0 23 elsif (defined $+{'timeout_directive'}) { }
8 15 elsif (defined $+{'error_directive'}) { }
7 8 elsif (defined $+{'autoerror_directive'}) { }
4 4 elsif (defined $+{'yadaerror_directive'}) { }
0 4 elsif (defined $+{'context_directive'}) { }
0 4 elsif (defined $+{'nocontext_directive'}) { }
4 0 elsif (defined $+{'ws_directive'}) { }
0 0 elsif (defined $+{'incomplete_request'}) { }
0 0 elsif (defined $+{'loose_quantifier'}) { }
1691 80 4 substr($+{'pattern'}, 0, 1) eq '(' ? :
1699 0 0 substr($+{'pattern'}, 0, 1) eq '(' ? :
1707 16 0 substr($+{'pattern'}, 0, 1) eq '(' ? :
1772 1 1 if ($+{'sign'} eq "?")
1859 3 6 if (substr($subrule, 0, 1) eq ":")
1864 5 4 $+{'slash'} eq '\\' || $+{'slash'} eq '\\_' ? :
1870 2 2 $+{'alias_backref'} ? :
5 4 $+{'backref'} ? :
1893 0 0 $separator =~ /\S/ ? :
1912 0 1345 if ($raw_regex =~ / \A %%?+ /x)
1964 0 4 $+{'yadaerror_directive'} eq '???' ? :
1970 0 0 if ($compiletime_debugging_requested)
1979 0 0 if ($compiletime_debugging_requested)
1988 0 4 if ($compiletime_debugging_requested)
2001 0 0 if ($request =~ /\A\s*<\s*\Z/) { }
2040 73 2202 if ($list_marker)
2041 70 3 $magic_ws ? :
2100 0 0 if ($template =~ /%t/)
2124 3778 0 if ($filename eq '-') { }
0 0 elsif (open my $fh, $mode, $filename) { }
2135 0 0 $from_where ? :
2168 0 434 unless $grammar_name
2184 4 9 unless ($grammar_name =~ /::/)
2188 13 0 if (exists $user_defined_grammar{$grammar_name}) { }
2189 0 13 if ($compiletime_debugging_requested)
2229 4 135 unless ($grammar_spec =~ m( < (?: [.?![:%\\/]? [^\W\d]\w* [^>]* | [.?!]{3} ) > )msx)
2324 1 134 $runtime_debugging_requested ? :
2334 1 134 $runtime_debugging_requested ? :
2371 0 260 if (++$subrule_names{$subrule_name} > 1) { }
2394 0 135 if ($main_regex =~ /\A (?: \s++ | \(\?\# [^)]* \) | \# [^\n]++ )* \z/msx)
2410 6 129 if ($main_regex =~ /$GRAMMAR_DIRECTIVE/) { }
2413 4 2 unless ($grammar_name =~ /::/)
2452 0 0 length($3) % 2 ? :
2453 0 131 $main_regex =~ s/ < context \s* : \s* > //gmsx ? :
4 131 $main_regex =~ s/ < nocontext \s* : \s* > //gmsx ? :
2458 6 129 if ($is_grammar) { }
2460 0 6 unless ($grammar_name =~ /::/)
2463 0 6 if ($compiletime_debugging_requested)
2478 0 6 if ($main_regex =~ /\A(\s*)\S/)
2499 0 129 if ($compiletime_debugging_requested)
2524 0 129 if ($compiletime_debugging_requested)
2544 0 260 if ($compiletime_debugging_requested)
2545 0 0 $objectify ? :
2551 4 252 $body =~ s/ < context \s* : \s* > //gmsx ? :
4 256 $body =~ s/ < nocontext \s* : \s* > //gmsx ? :
2572 0 260 if ($compiletime_debugging_requested)
2585 135 125 if ($type eq 'rule') { }
2591 0 4 if (not $defn =~ /\S/msx) { }
0 4 elsif (not $first_ws) { }
2678 6 129 if ($is_grammar) { }
2693 4 125 $nocontext ? :