Branch Coverage

blib/lib/Marpa/R2/SLR.pm
Criterion Covered Total %
branch 180 288 62.5


line true false branch
40 12 31 unless defined $start
62 25 61 unless (defined $sought_rules)
66 0 25 unless defined $symbol_id
75 0 25 unless scalar @{$sought_rules;}
87 151 848 unless defined $rule_id
88 522 326 if $dot_position != -1
89 250 76 unless scalar grep({$_ == $rule_id;} @{$sought_rules;})
90 0 76 if $origin >= $first_origin
94 74 77 if $first_origin <= $latest_earley_set
97 12 74 if $earley_set < 0
109 0 43 unless defined $g1_origin
127 0 1498 unless defined $start_earley_set and defined $length_in_parse_locations
138 0 1498 if $earley_set_for_first_position > $latest_earley_set
142 0 1498 if $earley_set_for_last_position > $latest_earley_set
157 0 1498 if $length_in_characters <= 0
222 0 957 unless defined $slg
227 0 957 unless (&blessed($slg) and $slg->isa($slg_class))
229 0 0 $ref_type ? :
254 0 957 unless (defined $recce_c)
260 0 956 if (defined $thick_g1_grammar->[15] or defined $thick_g1_grammar->[5] or not defined $thick_g1_grammar->[11])
268 0 957 if (defined(my $value = $g1_recce_args->{'leo'}))
269 0 0 $value ? :
289 1 956 if defined $too_many_earley_items
299 0 957 if (ref $event_is_active_arg ne "HASH")
339 0 957 unless ($recce_c->start_input)
346 1 956 if ($thick_g1_recce->[21] > 1)
349 0 3 unless say {$Marpa::R2::Internal::TRACE_FH;} qq[Expecting "$terminal" at earleme 0]
407 0 1396 unless ($ref_type)
413 0 1396 if ($ref_type ne "HASH")
428 957 67 if $method eq "new"
429 56 968 if $method eq "series_restart"
431 0 1024 if (scalar @bad_args)
442 26 998 if (exists $flat_args{'exhaustion'})
452 0 26 unless exists $exhaustion_actions->{$value}
458 20 1004 if (exists $flat_args{'rejection'})
468 0 20 unless exists $rejection_actions->{$value}
486 588 960 unless defined $index
497 0 2048 unless &Scalar::Util::looks_like_number($slr->[$trace_level_arg])
503 956 68 unless (defined $slr->[6])
552 0 957 if defined $self->[3]
557 0 957 if ((my $ref_type = ref $p_string) ne "SCALAR")
558 0 0 $ref_type ? :
564 0 957 unless (defined ${$p_string;})
575 2 955 if $trace_terminals
576 0 957 if $trace_lexers
580 31 925 if @{$self->[10];}
965 0 1315 unless defined $handler
967 1279 36 if &$handler($slr, $event)
974 0 1893 unless defined $slr->[3]
994 843 5182 unless $problem_code
998 0 5182 if ($trace_lexers > 2)
1006 0 0 unless print {$trace_file_handle;} "\n=== Progress report at line $line, column $column\n", $lex_tracer->lexer_progress_report($slr), "=== End of progress report at line $line, column $column\n"
1013 1011 4171 if $pause
1014 31 4140 if $problem_code eq "event"
1015 0 4140 if $problem_code eq "trace"
1024 8 4132 if ($problem_code eq "R1 exhausted before end" and $slr->[4] eq "event")
1033 22 4110 if ($problem_code eq "no lexeme" and $slr->[5] eq "event")
1042 0 4110 if ($problem_code eq "invalid char")
1049 4101 9 if ($problem_code eq "unregistered char")
1068 19735 155978 if ($character =~ /$re/)
1070 12 19723 if ($trace_terminals >= 2)
1078 10 2 if ($character =~ /[[:graph:]]+/)
1081 0 12 unless say {$trace_file_handle;} "Registering character $char_desc as symbol ${symbol_id}: ", $thick_lex_grammar->symbol_in_display_form($symbol_id)
1092 1 4100 unless (@ops)
1123 0 9 unless $problem_code
1150 2 7 if ($problem_code eq "R1 exhausted before end")
1157 0 7 if ($problem_code eq "SLIF loop")
1163 7 0 if ($problem_code eq "no lexeme")
1170 0 7 if (scalar @events > 100)
1181 0 2 if $event_type ne "'trace" or $trace_event_type ne "rejected lexeme"
1209 2 5 if (scalar @rejections) { }
1215 2 2 unless defined $rejection
1218 0 2 if ($rejection_count > 5)
1236 9 0 if (defined $problem)
1239 0 9 if ($stream_status == -1)
1243 0 9 if ($stream_status == -2)
1249 0 9 if ($stream_status == -3 or $stream_status == -5)
1253 0 9 if ($g1_status)
1264 0 0 if ($event_type eq "MARPA_EVENT_EARLEY_ITEM_THRESHOLD")
1269 0 0 if ($event_type eq "MARPA_EVENT_SYMBOL_EXPECTED")
1275 0 0 if ($event_type eq "MARPA_EVENT_EXHAUSTED")
1285 0 9 if ($g1_status < 0)
1292 9 0 if ($problem_pos < $length_of_string) { }
1299 0 9 $problem_pos >= 50 ? :
1319 0 9 if ($slr->[7])
1346 9 0 $char =~ /[[:graph:]]/msx ? :
1373 0 0 if substr ${$p_input;}, $pos, Deparse error: Can't locate object method "object_2svref" via package "B::SPECIAL" at /usr/local/lib/perl5/5.26.1/B/Deparse.pm line 5018.
1386 0 0 if $length_so_far > $length
1410 8 113 if $length_so_far > $length
1423 11 0 if $escaped_chars[$first_non_space_ix] ne " "
1427 0 11 if ($trailing_spaces)
1431 0 0 if $length_so_far > $length
1443 219 0 $ordering ? :
1452 0 208 if $ambiguity_metric <= 0
1453 204 4 if $ambiguity_metric == 1
1455 0 4 unless defined $asf
1465 0 2 if (not defined $input_ref or ref $input_ref ne "SCALAR")
1472 0 2 unless defined $arg1
1474 0 2 if ($reftype eq "HASH")
1482 2 0 if ($reftype eq "")
1487 0 2 if (ref $arg1 and ref $input_ref ne "HASH")
1493 0 2 if (grep {ref $_ ne "HASH";} @more_args)
1501 0 2 if ($length_read != length $input_length)
1508 0 2 if (my $ambiguous_status = $slr->ambiguous)
1514 0 2 unless $value_ref
1527 1 14 unless ($recce->[32])
1544 15 0 if (defined $rule_closure) { }
1546 15 0 if ($ref_rule_closure eq 'CODE') { }
0 0 elsif ($ref_rule_closure eq 'SCALAR') { }
1593 243 26 $input_length ? :
1594 179 90 if $input_start < $first_pos
1595 104 165 if $input_end > $last_pos
1604 129 12 if ($first_line == $last_line)
1605 58 71 if $first_column == $last_column
1623 2 11 unless (defined $start_ordinal)
1626 0 13 if ($start_ordinal < 0) { }
1630 0 13 if ($start_ordinal < 0 or $start_ordinal > $last_ordinal)
1637 12 1 if (not defined $end_ordinal) { }
1642 1 0 if ($end_ordinal < 0)
1645 0 1 if ($end_ordinal < 0)
1659 100 70 if ($position < 0)
1672 114 3 if ($origins_count <= 3) { }
1682 47 70 if ($position >= $rhs_length) { }
28 42 elsif ($position) { }
1691 15 102 if $origins_count > 1
1694 108 9 if ($current_earleme > 0) { }
1752 0 194 unless defined $symbol_name
1761 0 194 unless (defined $symbol_id)
1767 194 0 if $result == $Marpa::R2::Error::NONE
1772 0 0 if $result == $Marpa::R2::Error::UNEXPECTED_TOKEN_ID or $result == $Marpa::R2::Error::NO_TOKEN_EXPECTED_HERE or $result == $Marpa::R2::Error::INACCESSIBLE_TOKEN
1783 0 194 if defined $start and not &Scalar::Util::looks_like_number($start)
1787 0 194 if defined $length and not &Scalar::Util::looks_like_number($length)
1795 0 194 unless (defined $length)
1797 0 0 $pause_start == $thin_pos ? :
1801 0 194 if $return_value == 0
1809 0 163 unless $slr->lexeme_alternative($symbol_name, @value)
1827 1 66 unless defined $symbol
1884 0 12 unless defined $lexeme_id
1912 0 0 unless $resolution
1971 0 10 if ($ordinal < 0 or $ordinal > $last_ordinal)
1976 0 10 unless defined $recce_c->_marpa_r_earley_set_trace($ordinal)
1989 32 6 unless defined $leo_item_desc
2006 32 6 unless defined $base_ahm_id
2018 6 0 if (defined $base_rule_id) { }