Branch Coverage

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


line true false branch
40 173 102 if (_module_is_active() and $type =~ /qq?/) { }
51 93 0 if ($] >= 5.018)
53 0 93 if ($] < 5.018004)
105 92 0 if (ref $x)
106 36 56 if (ref $y)
107 20 72 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 330 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 413 1 unless $debugging_active
562 1790 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 2008 unless (@{$stack_ref;})
631 0 2008 if (my $class = &blessed($stack_ref->[-1]))
653 0 131 if (my $class = &blessed($stack_ref->[-1]))
683 0 102 keys %{$curr_frame;} ? :
544 102 $is_blessed_curr || length join('', keys %{$curr_frame;}) ? :
173 646 exists $curr_frame->{'='} ? :
688 88 731 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 212 607 if ($is_blessed_curr and not exists $curr_frame->{'='})
713 0 819 if ($is_blessed_caller)
744 0 947 keys %{$curr_frame;} ? :
231 947 $is_blessed_curr || length join('', keys %{$curr_frame;}) ? :
218 1178 exists $curr_frame->{'='} ? :
749 174 1222 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 118 1278 if ($is_blessed_curr and not exists $curr_frame->{'='})
777 0 1396 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 1790 if $is_comment
978 0 1790 $debug_runtime && $regex =~ /\S/ ? :
0 1790 $debug_runtime && $regex eq '|' ? :
988 0 0 if ($debug_build)
1004 0 0 if ($debug_build)
1005 0 0 $timeout == 1 ? :
0 0 $timeout > 0 ? :
1015 0 0 $timeout > 0 ? :
1027 0 0 if ($debug_build)
1054 0 3 if ($debug_build)
1081 11 8 $type eq 'error' ? :
1084 2 17 $type eq 'fatal' ? :
1087 4 15 if (substr($msg, 0, 3) eq '(?{') { }
1096 0 19 if ($debug_build)
1097 0 0 $type eq 'log' ? :
1106 11 8 $severity eq 'fail' ? :
0 19 $type eq 'log' ? :
1131 19 89 $is_codeblock ? :
1132 19 89 $is_codeblock ? :
1133 19 89 $is_codeblock ? :
1134 10 79 defined $backref ? :
19 89 $is_codeblock ? :
1137 19 89 $is_codeblock ? :
1144 0 108 $postmodifier && !$is_noncapturing ? :
0 108 substr($postmodifier, 0, 1) eq '?' ? :
0 108 $is_listifying && $postmodifier ? :
1149 0 108 if ($debug_build)
1150 0 0 $is_listifying ? :
0 0 $is_noncapturing ? :
1166 6 102 $is_noncapturing ? :
1177 0 108 $timeout ? :
1189 8 6 if (not defined $keypat && $keypat =~ /\S/) { }
1205 0 11 $postmodifier && !$is_noncapturing ? :
0 11 substr($postmodifier, 0, 1) eq '?' ? :
3 11 $is_listifying && $postmodifier ? :
1210 0 14 if ($debug_build)
1211 0 0 $is_listifying ? :
0 0 $is_noncapturing ? :
1227 4 10 $is_noncapturing ? :
1238 0 14 $timeout ? :
1255 70 3 length $ws ? :
1258 17 56 substr($op, -2) eq '%%' ? :
1262 0 73 $timeout ? :
1265 0 73 if ($debug_build)
1266 0 0 substr($op, -2) eq '%%' ? :
1279 51 22 if $op =~ / [*][*]() | [+]([+?]?) \s* %%?+ | \{ 1, \}([+?]?) \s* %%?+ /msx
1284 4 18 if $op =~ / [*]([+?]?) \s* %%? | \{ 0, \}([+?]?) \s* %%? /msx
1288 4 14 if $op =~ / [?]([+?]?) \s* %%? | \{ 0,1 \}([+?]?) \s* %%? /msx
1292 2 12 if $op =~ / \{ 0 \}[+?]? \s* %%? /msx
1296 2 10 if ($op =~ / \{ (\d+) \}([+?]?) \s* %%? /msx)
1303 2 8 if ($op =~ / \{ 0,(\d+) \}([+?]?) \s* %%? /msx)
1310 8 0 if ($op =~ / \{ (\d+),(\d*) \} ([+?]?) \s* %%? /msx)
1312 6 2 $2 ? :
1328 282 10 if ($args eq '') { }
1 9 elsif (substr($args, 0, 3) eq '(?{') { }
1344 3 289 $simple_subrule =~ s/(.*):://msx ? :
1345 290 2 unless ($start_grammar =~ /^NEXT$|::/)
1349 1 291 $start_grammar eq 'NEXT' ? :
1356 3 292 if ($CACHE{$inherited_subrule})
1367 0 292 unless ($valid_subrule_names_ref->{$subrule})
1382 88 196 $is_listifying ? :
8 284 $is_noncapturing ? :
1401 10 274 substr($postmodifier, 0, 1) eq '?' ? :
8 284 $is_listifying && $postmodifier ? :
1405 1 290 $savemode eq 'poslookahead' ? :
1 291 $savemode eq 'neglookahead' ? :
1409 0 292 if ($debug_build)
1410 0 0 defined $arg_desc ? :
0 0 $is_listifying ? :
0 0 $is_noncapturing ? :
1429 0 292 $timeout ? :
1447 38 218 $objectify ? :
1457 6 250 $callname eq 'ws' || $callname eq 'hk' ? :
1492 134 122 $magic_ws ? :
256 128 $rule_name ? :
1680 2101 131 ($+{'alias'} // 'MATCH') eq 'MATCH' ? :
1686 82 2150 if (defined $+{'alias_parens_scalar'}) { }
0 2150 elsif (defined $+{'alias_parens_scalar_nocap'}) { }
16 2134 elsif (defined $+{'alias_parens_list'}) { }
7 2127 elsif (defined $+{'alias_hash_scalar'}) { }
4 2123 elsif (defined $+{'alias_hash_scalar_nocap'}) { }
3 2120 elsif (defined $+{'alias_hash_list'}) { }
22 2098 elsif (defined $+{'alias_subrule_scalar'}) { }
26 2072 elsif (defined $+{'alias_subrule_list'}) { }
2 2070 elsif (defined $+{'self_subrule_lookahead'}) { }
6 2064 elsif (defined $+{'self_subrule_scalar_nocap'}) { }
174 1890 elsif (defined $+{'self_subrule_scalar'}) { }
62 1828 elsif (defined $+{'self_subrule_list'}) { }
0 1828 elsif (defined $+{'alias_argrule_scalar'}) { }
0 1828 elsif (defined $+{'alias_argrule_list'}) { }
1 1827 elsif (defined $+{'self_argrule_scalar'}) { }
9 1818 elsif (defined $+{'backref'} or $+{'alias_backref'} or $+{'alias_backref_list'}) { }
474 1344 elsif (defined $+{'reportable_raw_regex'}) { }
0 1344 elsif (defined $+{'complex_repetition'}) { }
1318 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'}) { }
1687 78 4 substr($+{'pattern'}, 0, 1) eq '(' ? :
1695 0 0 substr($+{'pattern'}, 0, 1) eq '(' ? :
1703 16 0 substr($+{'pattern'}, 0, 1) eq '(' ? :
1768 1 1 if ($+{'sign'} eq '?')
1855 3 6 if (substr($subrule, 0, 1) eq ':')
1860 5 4 $+{'slash'} eq '\\' || $+{'slash'} eq '\\_' ? :
1866 2 2 $+{'alias_backref'} ? :
5 4 $+{'backref'} ? :
1889 0 0 $separator =~ /\S/ ? :
1908 0 1318 if ($raw_regex =~ / \A %%?+ /x)
1960 0 4 $+{'yadaerror_directive'} eq '???' ? :
1966 0 0 if ($compiletime_debugging_requested)
1975 0 0 if ($compiletime_debugging_requested)
1984 0 4 if ($compiletime_debugging_requested)
1997 0 0 if ($request =~ /\A\s*<\s*\Z/) { }
2036 73 2159 if ($list_marker)
2037 70 3 $magic_ws ? :
2096 0 0 if ($template =~ /%t/)
2120 3777 0 if ($filename eq '-') { }
0 0 elsif (open my $fh, $mode, $filename) { }
2131 0 0 $from_where ? :
2164 0 425 unless $grammar_name
2180 3 9 unless ($grammar_name =~ /::/)
2184 12 0 if (exists $user_defined_grammar{$grammar_name}) { }
2185 0 12 if ($compiletime_debugging_requested)
2225 4 133 unless ($grammar_spec =~ m( < (?: [.?![:%\\/]? [^\W\d]\w* [^>]* | [.?!]{3} ) > )msx)
2320 1 132 $runtime_debugging_requested ? :
2330 1 132 $runtime_debugging_requested ? :
2367 0 256 if (++$subrule_names{$subrule_name} > 1) { }
2390 0 133 if ($main_regex =~ /\A (?: \s++ | \(\?\# [^)]* \) | \# [^\n]++ )* \z/msx)
2406 5 128 if ($main_regex =~ /$GRAMMAR_DIRECTIVE/) { }
2409 3 2 unless ($grammar_name =~ /::/)
2448 0 0 length($3) % 2 ? :
2449 0 129 $main_regex =~ s/ < context \s* : \s* > //gmsx ? :
4 129 $main_regex =~ s/ < nocontext \s* : \s* > //gmsx ? :
2454 5 128 if ($is_grammar) { }
2456 0 5 unless ($grammar_name =~ /::/)
2459 0 5 if ($compiletime_debugging_requested)
2474 0 5 if ($main_regex =~ /\A(\s*)\S/)
2495 0 128 if ($compiletime_debugging_requested)
2520 0 128 if ($compiletime_debugging_requested)
2540 0 256 if ($compiletime_debugging_requested)
2541 0 0 $objectify ? :
2547 4 248 $body =~ s/ < context \s* : \s* > //gmsx ? :
4 252 $body =~ s/ < nocontext \s* : \s* > //gmsx ? :
2568 0 256 if ($compiletime_debugging_requested)
2581 134 122 if ($type eq 'rule') { }
2587 0 4 if (not $defn =~ /\S/msx) { }
0 4 elsif (not $first_ws) { }
2668 5 128 if ($is_grammar) { }
2683 4 124 $nocontext ? :