Condition Coverage

blib/lib/MarpaX/G4/MarpaGen.pm
Criterion Covered Total %
condition 154 303 50.8


and 3 conditions

line !l l&&!r l&&r condition
285 1 0 0 exists $mxtoken->{'rhs'} and exists $mxtoken->{'rhs'}{'token'}
367 9 0 0 $rulename =~ /^[a-z]$/i and $s =~ /([a-z])([a-z])/i
9 0 0 $rulename =~ /^[a-z]$/i and $s =~ /([a-z])([a-z])/i and uc "$1" eq "$2" || lc "$1" eq "$2"
381 23 6 1 $string =~ /([a-z])([a-z])/i and uc "$1" eq "$2" || lc "$1" eq "$2"
409 0 0 0 isSingleChar($begr) and isSingleChar($endr)
457 9 5 4 defined $cardinality and $cardinality eq "?"
494 9 5 4 defined $cardinality and $cardinality eq "?"
504 14 4 0 exists $mxelement->{'class4list'} and not defined $cardinality
529 0 40 0 ref $token eq "HASH" and exists $token->{'comment'}
40 0 0 ref $token eq "HASH" and exists $token->{'comment'} and not $self->testoption("stripallcomments")
547 0 1 39 ref $token eq "HASH" and exists $token->{'type'}
1 30 9 ref $token eq "HASH" and exists $token->{'type'} and $token->{'type'} eq "tokengroup"
554 0 1 30 ref $token eq "HASH" and exists $token->{'type'}
1 30 0 ref $token eq "HASH" and exists $token->{'type'} and $token->{'type'} eq "rulegroup"
563 0 1 30 ref $token eq "HASH" and exists $token->{'type'}
1 9 21 ref $token eq "HASH" and exists $token->{'type'} and $token->{'type'} eq "literal"
570 0 1 9 ref $token eq "HASH" and exists $token->{'type'}
1 0 9 ref $token eq "HASH" and exists $token->{'type'} and $token->{'type'} eq "class"
574 0 1 0 ref $token eq "HASH" and exists $token->{'type'}
1 0 0 ref $token eq "HASH" and exists $token->{'type'} and $token->{'type'} eq "regex"
578 0 1 0 ref $token eq "HASH" and exists $token->{'type'}
1 0 0 ref $token eq "HASH" and exists $token->{'type'} and $token->{'type'} eq "range"
582 0 1 0 ref $token eq "HASH" and exists $token->{'type'}
1 0 0 ref $token eq "HASH" and exists $token->{'type'} and $token->{'type'} eq "value"
586 0 0 1 ref $token eq "HASH" and exists $token->{'token'}
590 0 0 0 ref $token eq "HASH" and exists $token->{'action'}
594 0 0 0 ref $token eq "HASH" and exists $token->{'comment'}
628 40 0 0 scalar @$comments > 0 and not $self->testoption("stripallcomments")
672 6 0 0 $cardinality =~ /[+*]\?/ and $self->testoption("shiftlazytogreedy")
726 0 1 0 exists $mxtoken->{'type'} and $mxtoken->{'type'} eq "group"
734 0 0 0 exists $le->{'type'} and not $le->{'type'} =~ /literal|class/
741 0 1 0 exists $mxtoken->{'type'} and $mxtoken->{'type'} eq "literal"
746 0 0 1 exists $mxtoken->{'type'} and $mxtoken->{'type'} eq "class"
752 0 0 0 exists $mxtoken->{'type'} and $mxtoken->{'type'} eq "negatedclass"
803 7 1 4 exists $rhs->{'type'} and $rhs->{'type'} eq "literal"
811 0 2 0 $tmp1 ne '' && $tmp1 eq $tmp2
861 0 23 37 ref $e eq "HASH" and exists $e->{'rhs'}
23 0 37 ref $e eq "HASH" and exists $e->{'rhs'} and not exists $e->{'token'}
862 0 56 4 ref $e eq "HASH" and exists $e->{'type'}
56 0 4 ref $e eq "HASH" and exists $e->{'type'} and exists $e->{'definition'}
869 0 0 0 exists $e->{'comment'} and not $self->testoption("stripallcomments")
875 0 0 0 exists $e->{'action'} and not $self->testoption("stripactions")
887 0 60 0 ref $e eq "HASH" and not exists $e->{'token'}
889 0 0 0 exists $e->{'type'} and $e->{'type'} eq "regex"
908 0 10 1 $self->testoption("buildkeywords") and $keywordfragment->{'status'} == 0
10 1 0 $self->testoption("buildkeywords") and $keywordfragment->{'status'} == 0 and $keyword =~ /^[a-z]/i
960 9 30 0 exists $mxelement->{'type'} and $mxelement->{'type'} eq "ignore"
1004 9 0 1 scalar @$rhslist <= 1 and $self->retagSimpleRule($rulename, $mxelement, $cardinality, $context)
1010 1 0 0 defined $alternative and scalar @$rhslist > 1
1029 4 5 0 $cardinality ne "?" and not $self->retagSimpleRule($rulename, $mxelement, $cardinality, $context, {"abortatfirstlevel", "true"})
1059 0 20 3 $self->testoption("buildkeywords") and $keywordfragment->{'status'} == 0
20 3 0 $self->testoption("buildkeywords") and $keywordfragment->{'status'} == 0 and $keywordfragment->{'value'} =~ /^[a-z]/i
1132 0 0 0 $rulestatus eq "synthetic" and not $self->checkMarpaRuleExists($rulename)
1157 5 0 9 exists $rule->{'grammarstate'} and $rule->{'grammarstate'} eq "lexer"
1158 8 0 6 exists $rule->{'type'} and $rule->{'type'} eq "fragment"
1172 5 0 9 exists $rule->{'grammarstate'} and $rule->{'grammarstate'} eq "lexer"
1173 8 0 6 exists $rule->{'type'} and $rule->{'type'} eq "fragment"
1248 0 0 0 exists $rule->{'grammarstate'} && $rule->{'grammarstate'} =~ /lexer/i
1272 13 0 1 not exists $rule->{'generationstatus'} and exists $rule->{'redirect'}
1381 0 39 0 $self->testoption("matchcaseinsensitive") and $self->isKeywordLetter($token, $rule)
1569 39 29 1 exists $rhs->{'type'} and $rhs->{'type'} eq "negatedclass"
1580 39 29 0 exists $rhs->{'type'} and $rhs->{'type'} eq "unsupported"
1584 39 21 8 exists $rhs->{'type'} and $rhs->{'type'} eq "class"
1588 0 5 3 $self->testoption("matchcaseinsensitive") and $self->isAlphaLiteral($value)
1597 39 0 21 exists $rhs->{'type'} and $rhs->{'type'} eq "literal"
1601 0 17 4 $self->testoption("matchcaseinsensitive") and $self->isAlphaLiteral($literal)
1609 39 0 0 exists $rhs->{'type'} and $rhs->{'type'} eq "action"
1662 69 0 0 $cardinality =~ /[+*]\?/ and $self->testoption("shiftlazytogreedy")
1676 0 65 4 defined $cardinality and $cardinality eq "?"
1780 34 25 0 exists $rhs->{'type'} and $rhs->{'type'} eq "group"
59 0 0 exists $rhs->{'type'} and $rhs->{'type'} eq "group" and exists $rhs->{'list'}
1873 0 32 0 $self->testoption("buildkeywords") and $self->isKeywordLetter($rulename, $rule)
1882 0 4 28 $self->testoption("fragment2class") and not $rulename =~ /^opt_/
4 27 1 $self->testoption("fragment2class") and not $rulename =~ /^opt_/ and fragmentEligible2Convert($rule)
1930 2 0 14 defined $rule and exists $rule->{'name'}
0 0 14 defined $rule and exists $rule->{'name'} and exists $rule->{'generationstatus'}
2026 16 0 0 exists $rule->{'comment'} and not $self->testoption("stripallcomments")
2037 0 2 14 defined $rule and exists $rule->{'name'}
2 0 14 defined $rule and exists $rule->{'name'} and exists $rule->{'generationstatus'}
2050 6 4 4 exists $subrules->{$rulename} and not $subrulestatus
10 0 4 exists $subrules->{$rulename} and not $subrulestatus and $rulegeneratedoutput

or 3 conditions

line l !l&&r !l&&!r condition
26 0 1 0 ref $invocant || $invocant
367 0 0 0 uc "$1" eq "$2" || lc "$1" eq "$2"
381 0 1 6 uc "$1" eq "$2" || lc "$1" eq "$2"
404 0 0 0 $begr->{'type'} ne "literal" or $endr->{'type'} ne "literal"
422 78 12 30 not exists $mxelement->{'class4list'} or $tracker->{'status'} == -1
438 37 8 15 not exists $mxelement->{'keywordfragment'} or $tracker->{'status'} == -1
684 0 0 5 not exists $rhs->{'token'} or ref $rhs->{'token'} ne ""
731 0 0 0 ref $al ne "HASH" or not exists $al->{'list'}
867 0 0 60 exists $e->{'comment'} or exists $e->{'action'}
957 0 0 39 ref $e ne "HASH" or not exists $e->{'token'}
1101 0 0 9 ref $tokengroup ne "HASH" or not exists $tokengroup->{'definition'}
1491 1 0 2 exists $$classhash{lc $key} or exists $$classhash{uc $key}
1495 1 0 1 $beg =~ /[a-z]/i or $end =~ /[a-z]/i
1512 0 1 7 exists $$characterhash{lc $c} or exists $$characterhash{uc $c}
1616 0 0 39 not exists $rhs->{'token'} or ref $rhs->{'token'} ne ""
1656 0 0 69 ref $options ne "HASH" or not exists $options->{'delimiter'}
1860 5 10 17 exists $rule->{'isLexeme'} or exists $rule->{'isFragmentOrChild'}
10 8 9 exists $rule->{'isLexeme'} or exists $rule->{'isFragmentOrChild'} or exists $rule->{'grammarstate'}
1968 0 0 1 not exists $self->{'discarded'} or ref $self->{'discarded'} ne "ARRAY"
0 0 1 not exists $self->{'discarded'} or ref $self->{'discarded'} ne "ARRAY" or scalar @{$self->{'discarded'};} < 1