Branch Coverage

blib/lib/Business/UDC/Parser.pm
Criterion Covered Total %
branch 66 82 80.4


line true false branch
21 3 61 unless (defined $input)
24 2 59 unless ($input =~ /\S/)
36 2 38 if ($state->{'pos'} < @{$state->{'tokens'};})
59 0 4 unless ($tok)
62 0 4 if ($tok->{'type'} ne $type)
76 6 24 unless (is_operator_token($tok->{'type'}))
79 0 24 unless (is_valid_operator($tok->{'value'}))
84 1 23 unless my $next = _peek($state)
88 2 21 if $next->{'type'} ne "LBRACK" and not can_follow_operator($op->{'value'}, $next->{'type'})
91 4 17 if ($op->{'value'} eq "/" and $right->{'type'} eq "APOS_AUX")
93 2 2 unless ($from)
118 7 10 if ($op->{'value'} eq "/")
124 0 1 unless (can_follow_primary($next_tok->{'type'}, $next_tok->{'value'}, $current_type, $current_value))
143 1 6 if (@modifiers)
159 0 74 unless my $tok = _peek($state)
162 4 70 if ($tok->{'type'} eq "LBRACK")
166 61 9 if (is_primary_token($tok->{'type'}))
174 3 6 if ($tok->{'type'} eq "ALPHA_SPEC")
181 1 5 if ($tok->{'type'} eq "APOS_AUX")
197 0 4 unless ($end)
202 0 4 if ($end->{'type'} ne "RBRACK")
219 13 51 if ($primary->{'type'} ne "NUMBER")
221 4 9 if ($next and $next->{'type'} eq "NUMBER")
222 1 3 unless (can_precede_number($primary->{'type'}, $primary->{'value'}))
223 1 0 defined $primary->{'value'} ? :
234 0 1 if (&any(sub { $tok->{'type'} eq $_; } , 'APOS_AUX', 'AUX_DOT')) { }
0 1 elsif (not can_follow_primary($tok->{'type'}, $tok->{'value'}, $current_type, $current_value)) { }
235 0 0 unless ($has_main_number)
280 1 68 if ($tok->{'type'} eq "LBRACK")
291 4 64 if ($tok->{'type'} eq "AUX_DOT")
292 1 3 unless ($allow_dot_aux)
296 29 38 unless (can_follow_primary($tok->{'type'}, $tok->{'value'}, $current_type, $current_value))
326 0 21 unless my $tok = _peek($state)
329 2 19 if ($op eq "/" and $tok->{'type'} eq "AUX_DOT")
337 1 18 if ($op eq "/" and $tok->{'type'} eq "FORM")
345 4 14 if ($op eq "/" and $tok->{'type'} eq "APOS_AUX")
365 0 4 unless (defined $node)
368 1 3 if ($node->{'type'} ne "TERM")
371 1 2 unless ($node->{'modifiers'} and @{$node->{'modifiers'};})
377 0 2 if (not defined $last or $last->{'type'} ne "APOS_AUX")
389 0 2 if (exists $node->{'prefixes'})