Condition Coverage

blib/lib/MarpaX/G4/MarpaGen.pm
Criterion Covered Total %
condition 156 303 51.4


and 3 conditions

line !l l&&!r l&&r condition
229 9 5 4 defined $cardinality and $cardinality eq "?"
283 1 0 0 exists $mxtoken->{'rhs'} and exists $mxtoken->{'rhs'}{'token'}
365 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"
379 23 6 1 $string =~ /([a-z])([a-z])/i and uc "$1" eq "$2" || lc "$1" eq "$2"
407 0 0 0 isSingleChar($begr) and isSingleChar($endr)
473 9 5 4 defined $cardinality and $cardinality eq "?"
483 14 4 0 exists $mxelement->{'class4list'} and not defined $cardinality
523 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")
541 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"
548 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"
557 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"
575 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"
579 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"
583 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"
587 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"
591 0 0 1 ref $token eq "HASH" and exists $token->{'token'}
595 0 0 0 ref $token eq "HASH" and exists $token->{'action'}
599 0 0 0 ref $token eq "HASH" and exists $token->{'comment'}
633 40 0 0 scalar @$comments > 0 and not $self->testoption("stripallcomments")
677 6 0 0 $cardinality =~ /[+*]\?/ and $self->testoption("shiftlazytogreedy")
680 1 0 5 defined $options && ref $options eq 'HASH' && exists $options->{'abortatfirstlevel'}
729 0 1 0 exists $mxtoken->{'type'} and $mxtoken->{'type'} eq "group"
737 0 0 0 exists $le->{'type'} and not $le->{'type'} =~ /literal|class/
744 0 1 0 exists $mxtoken->{'type'} and $mxtoken->{'type'} eq "literal"
749 0 0 1 exists $mxtoken->{'type'} and $mxtoken->{'type'} eq "class"
755 0 0 0 exists $mxtoken->{'type'} and $mxtoken->{'type'} eq "negatedclass"
806 7 1 4 exists $rhs->{'type'} and $rhs->{'type'} eq "literal"
814 0 2 0 $tmp1 ne '' && $tmp1 eq $tmp2
864 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'}
865 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'}
872 0 0 0 exists $e->{'comment'} and not $self->testoption("stripallcomments")
878 0 0 0 exists $e->{'action'} and not $self->testoption("stripactions")
890 0 60 0 ref $e eq "HASH" and not exists $e->{'token'}
892 0 0 0 exists $e->{'type'} and $e->{'type'} eq "regex"
911 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
963 9 30 0 exists $mxelement->{'type'} and $mxelement->{'type'} eq "ignore"
1007 9 0 1 scalar @$rhslist <= 1 and $self->retagSimpleRule($rulename, $mxelement, $cardinality, $context)
1031 4 5 0 $cardinality ne "?" and not $self->retagSimpleRule($rulename, $mxelement, $cardinality, $context, {"abortatfirstlevel", "true"})
1061 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
1128 9 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"
1247 0 0 0 exists $rule->{'grammarstate'} && $rule->{'grammarstate'} =~ /lexer/i
1271 13 0 1 not exists $rule->{'generationstatus'} and exists $rule->{'redirect'}
1380 0 39 0 $self->testoption("matchcaseinsensitive") and $self->isKeywordLetter($token, $rule)
1533 39 29 1 exists $rhs->{'type'} and $rhs->{'type'} eq "negatedclass"
1542 39 29 0 exists $rhs->{'type'} and $rhs->{'type'} eq "unsupported"
1546 39 21 8 exists $rhs->{'type'} and $rhs->{'type'} eq "class"
1549 0 5 3 $self->testoption("matchcaseinsensitive") and $self->isAlphaLiteral($value)
1558 39 0 21 exists $rhs->{'type'} and $rhs->{'type'} eq "literal"
1561 0 17 4 $self->testoption("matchcaseinsensitive") and $self->isAlphaLiteral($literal)
1569 39 0 0 exists $rhs->{'type'} and $rhs->{'type'} eq "action"
1622 69 0 0 $cardinality =~ /[+*]\?/ and $self->testoption("shiftlazytogreedy")
1636 0 65 4 defined $cardinality and $cardinality eq "?"
1738 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'}
1831 0 32 0 $self->testoption("buildkeywords") and $self->isKeywordLetter($rulename, $rule)
1840 0 4 28 $self->testoption("fragment2class") and not $rulename =~ /^opt_/
4 27 1 $self->testoption("fragment2class") and not $rulename =~ /^opt_/ and fragmentEligible2Convert($rule)
1888 2 0 14 defined $rule and exists $rule->{'name'}
0 0 14 defined $rule and exists $rule->{'name'} and exists $rule->{'generationstatus'}
1985 16 0 0 exists $rule->{'comment'} and not $self->testoption("stripallcomments")
1996 0 2 14 defined $rule and exists $rule->{'name'}
2 0 14 defined $rule and exists $rule->{'name'} and exists $rule->{'generationstatus'}
2009 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
365 0 0 0 uc "$1" eq "$2" || lc "$1" eq "$2"
379 0 1 6 uc "$1" eq "$2" || lc "$1" eq "$2"
402 0 0 0 $begr->{'type'} ne "literal" or $endr->{'type'} ne "literal"
420 78 12 30 not exists $mxelement->{'class4list'} or $tracker->{'status'} == -1
436 37 8 15 not exists $mxelement->{'keywordfragment'} or $tracker->{'status'} == -1
687 0 0 5 not exists $rhs->{'token'} or ref $rhs->{'token'} ne ""
734 0 0 0 ref $al ne "HASH" or not exists $al->{'list'}
870 0 0 60 exists $e->{'comment'} or exists $e->{'action'}
960 0 0 39 ref $e ne "HASH" or not exists $e->{'token'}
1103 0 0 9 ref $tokengroup ne "HASH" or not exists $tokengroup->{'definition'}
1454 1 0 2 exists $$classhash{lc $key} or exists $$classhash{uc $key}
1458 1 0 1 $beg =~ /[a-z]/i or $end =~ /[a-z]/i
1475 0 1 7 exists $$characterhash{lc $c} or exists $$characterhash{uc $c}
1576 0 0 39 not exists $rhs->{'token'} or ref $rhs->{'token'} ne ""
1616 0 0 69 ref $options ne "HASH" or not exists $options->{'delimiter'}
1818 5 10 17 exists $rule->{'isLexeme'} or exists $rule->{'isFragmentOrChild'}
10 8 9 exists $rule->{'isLexeme'} or exists $rule->{'isFragmentOrChild'} or exists $rule->{'grammarstate'}
1926 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