Branch Coverage

blib/lib/Marpa/PP/Value.pm
Criterion Covered Total %
branch 235 354 66.3


line true false branch
208 10591 3475 if (defined $cause_id) { }
225 0 237 unless defined $or_node
248 16 7 $cause_type eq 'C' ? :
7 16 $cause_type eq 'S' ? :
255 0 3 unless $$a[0] <=> $$b[0] or $$a[1] <=> $$b[1] or $$a[2] <=> $$b[2] or $$a[3] <=> $$b[3] or $$a[4] <=> $$b[4] or $$a[5] <=> $$b[5]
278 0 33 unless $$a[2] <=> $$b[2] or $$a[3] <=> $$b[3] or $$a[0] <=> $$b[0]
297 0 0 unless (defined $and_node_ids)
303 0 0 unless (defined $choices)
308 0 0 if (defined $choice)
325 0 0 unless defined $rank_ref
326 0 0 if $rank_ref == -1
352 0 0 $$iteration_node[7] ? :
375 0 0 unless (defined $and_node_ids)
381 0 0 unless (defined $choices)
385 0 0 unless (scalar @{$choices;})
398 0 0 if ($verbose)
403 0 0 unless $verbose
442 3718 578 unless $$symbol[3]
445 18 560 if ($$symbol[5]) { }
452 475 103 unless defined $null_value
457 0 103 if ($trace_values)
458 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Setting null value for symbol ', $$symbol[1], ' to ', 'Data::Dumper'->new([\$null_value])->Terse(1)->Dump
480 0 5304 unless defined $closure_name
483 3220 2084 if (my $closure = $$closures{$closure_name})
484 0 3220 if ($trace_actions)
485 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} qq[Resolved "$closure_name" to explicit closure\n]
495 219 1865 if ($closure_name =~ /([:][:])|[']/msx)
499 214 1651 if (defined(my $actions_package = $$grammar[4]))
509 5 1646 if (defined(my $action_object_class = $$grammar[16]))
520 1646 438 unless defined $fully_qualified_name
526 0 438 if ($trace_actions)
527 0 0 $closure ? :
0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} ($closure ? 'Successful' : 'Failed') . qq[ resolution of "$closure_name" ], 'to ', $fully_qualified_name, "\n"
550 169 66 if (defined $default_action)
554 0 169 unless $default_action_closure
561 1331 6335 unless $$rule[3]
569 1237 5098 if ($virtual_lhs)
570 361 876 $virtual_rhs ? :
582 444 4654 if ($virtual_rhs) { }
4654 0 elsif (my $argc = scalar @{$$rule[2];}) { }
595 3394 1704 if (my $action = $$rule[4])
600 0 3394 unless defined $closure
611 1704 0 if (my $action = $$rule[1][1])
615 23 1681 if (not $action =~ /[\]] \z/msx and defined(my $closure = Marpa::PP::Internal::Recognizer::resolve_semantics($recce, $action)))
629 484 1197 if (defined $default_action_closure)
656 0 22 if (defined $cycle_ranking_action)
660 0 0 unless $cycle_closure
670 908 0 unless defined $ranking_action
675 0 0 unless defined $ranking_closure
692 0 1536 if $ranking_action and $cycle_rule
700 36 1500 if ($ranking_action)
704 0 36 unless defined $ranking_closure
709 0 1536 if ($cycle_rule)
713 1500 36 unless $ranking_closure
719 16 20 unless (scalar @{$$rule[2];})
720 0 16 unless defined $ranking_closure
731 20 16 unless $$rule[3]
750 242 876 if ($token_name)
769 2111 125 unless defined $closure
784 0 125 if (not $eval_ok or scalar @warnings)
788 0 125 if (defined $rank_ref and not ref $rank_ref)
794 0 125 if (defined $fatal_error)
816 242 876 if ($token_name)
825 0 1118 if (defined $token_rank_ref and not ref $token_rank_ref)
834 45 1073 if (defined $rule_rank_ref)
835 25 20 $$and_node[5] ? :
846 150 923 if ($token_name and not defined $$and_node[6])
855 195 923 if (defined $constant_rank_ref)
881 2 925 if defined $$and_node[9]
896 740 1097 unless defined $or_node_id
899 99 998 if (defined(my $or_node_initial_rank_ref = $$or_node[7]))
906 99 0 if (ref $or_node_initial_rank_ref)
928 2 1036 unless (defined $rank_ref)
936 103 933 unless ref $rank_ref
944 2 996 if (scalar @unranked_and_nodes)
952 103 893 unless (scalar @ranks)
972 63 757 defined $token_rank_ref ? :
994 1 2227 if (defined $action_object_class)
999 0 1 unless defined $closure
1006 1 2227 if ($action_object_constructor)
1024 0 1 if (not $eval_ok or @warnings)
1042 0 53361 if ($trace_values >= 3)
1044 0 0 unless printf {$Marpa::PP::Internal::TRACE_FH;} 'Stack position %3d:', $i
1047 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} ' ', 'Data::Dumper'->new([$evaluation_stack[$i]])->Terse(1)->Dump
1056 22616 30745 if (defined $value_ref)
1060 14 22602 if ($trace_values)
1064 14 0 $token_name ? :
0 14 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Pushed value from ', $$and_node[1], ': ', $token_name ? "$token_name = " : '', 'Data::Dumper'->new([$value_ref])->Terse(1)->Dump
1076 20388 32973 unless defined $ops
1087 18 20081 if ($trace_values)
1091 0 18 unless say {$Marpa::PP::Internal::TRACE_FH;} 'Popping ', $argc, ' values to evaluate ', $$and_node[1], ', rule: ', Marpa::PP::brief_rule($rule)
1110 0 1715 if ($trace_values)
1114 0 0 unless say {$Marpa::PP::Internal::TRACE_FH;} 'Head of Virtual Rule: ', $$and_node[1], ', rule: ', Marpa::PP::brief_rule($rule), "\n", "Incrementing virtual rule by $real_symbol_count symbols\n", 'Currently ', scalar @virtual_rule_stack, ' rules; ', $virtual_rule_stack[-1], ' symbols;'
1139 0 7222 if ($trace_values)
1143 0 0 unless say {$Marpa::PP::Internal::TRACE_FH;} 'Virtual Rule: ', $$and_node[1], ', rule: ', Marpa::PP::brief_rule($rule), "\nAdding $real_symbol_count"
1157 2 3935 if ($trace_values)
1161 0 2 unless say {$Marpa::PP::Internal::TRACE_FH;} 'New Virtual Rule: ', $$and_node[1], ', rule: ', Marpa::PP::brief_rule($rule), "\nReal symbol count is $real_symbol_count"
1176 0 6573 if ($trace_values)
1177 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Constant result: ', 'Pushing 1 value on stack: ', 'Data::Dumper'->new([$result])->Terse(1)->Dump
1194 32 15209 if ($$original_rule[8])
1221 6 15235 if (not $eval_ok or @warnings)
1235 18 15217 if ($trace_values)
1236 0 18 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Calculated and pushed value: ', 'Data::Dumper'->new([$result])->Terse(1)->Dump
1266 0 18 if $$recce[23]++
1314 0 2313 if ($$recce[22])
1324 0 2313 if ($max_parses and $parse_count > $max_parses)
1330 0 7 if (exists $$arg_hash{'end'})
1331 0 0 if ($parse_count)
1340 0 7 if (exists $$arg_hash{'closures'})
1341 0 0 if ($parse_count)
1348 0 0 if ref $closure ne 'CODE'
1355 0 7 if (exists $$arg_hash{'trace_actions'})
1362 2 5 if (exists $$arg_hash{'trace_values'})
1372 2 12 if (exists $$arg_hash{$trace_fh_alias})
1381 0 7 if @unknown_arg_names
1395 0 2313 if $furthest_earleme > $last_completed_earleme
1420 2078 235 if ($parse_count) { }
1433 1286 235 unless $start_rule
1438 0 235 unless $start_rule
1443 18 217 if $$start_rule[1][3]
1475 217 103744 if ($task_type == 0)
1477 0 217 if ($trace_tasks)
1478 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Task: INITIALIZE; ', scalar @task_list, " tasks pending\n"
1527 22 195 if ($ranking_method eq 'constant')
1546 2089 101655 if ($task_type == 4)
1548 0 2089 if ($trace_tasks)
1549 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Task: ITERATE; ', scalar @task_list, " tasks pending\n"
1582 2004 9 unless $and_node_in_use[$and_node_id]
1595 32179 27778 unless $$parent_node[7]
1609 32375 2004 unless (scalar @{$choices;})
1613 32302 73 if (defined $direct_parent)
1620 18716 13586 $child_type == 6 ? :
1653 85 2004 unless defined $iteration_node
1667 2210 94493 unless scalar @{$iteration_node_worklist;}
1670 0 94493 if ($trace_tasks)
1673 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Task: FIX_TREE; ', scalar @{$iteration_node_worklist;}, " current iteration node #$working_node_ix; ", scalar @task_list, " tasks pending\n"
1694 73913 94389 if defined $ix
1695 51131 43258 $field == 4 ? :
1702 53341 41048 unless (defined $or_node_id)
1734 13140 45257 if ($task_type == 1)
1738 0 13140 if ($trace_tasks)
1739 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Task: POPULATE_OR_NODE o', $$work_or_node[0], '; ', scalar @task_list, " tasks pending\n"
1774 11 13129 defined $$item[4] ? :
1797 1255 1524 unless ($next_leo_item)
1838 1306 218 unless (defined $target_item)
1898 996 12144 if ($$work_symbol[3])
1930 4597 10397 if ($work_position > 0)
1946 1084 3513 if ($predecessor_or_node)
1981 0 3513 if $predecessor_id & -2147483648
1996 11536 3458 if (defined $cause)
2028 2186 9410 if ($cause_or_node)
2061 0 9410 if $cause_id & -2147483648
2123 10465 3560 $work_position == $#{$$work_rule[2];} ? :
2135 0 14025 if $id & -2147483648
2151 41271 3986 if ($task_type == 6)
2157 0 41271 if ($trace_tasks)
2158 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Task: STACK_INODE o', $$or_node[0], '; ', scalar @task_list, " tasks pending\n"
2171 0 41271 unless (defined $and_node_ids)
2182 41265 6 unless (defined $choices)
2184 302 40963 if ($ranking_method eq 'constant') { }
2197 0 356 unless defined $rank_ref
2199 4 352 unless ref $rank_ref
2224 4 41267 unless (scalar @{$choices;})
2240 13 41254 if ($and_node_in_use[$and_node_id])
2247 6 7 if (scalar @{$choices;} > 1)
2261 41041 213 if (defined(my $child_type = $$work_iteration_node[5]))
2276 20360 20681 $child_type == 6 ? :
2283 41041 213 if defined $iteration_node_worklist
2291 22 3964 if ($task_type == 3)
2293 0 22 if ($trace_tasks)
2294 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Task: RANK_ALL; ', scalar @task_list, " tasks pending\n"
2310 3964 0 if ($task_type == 2)
2313 0 3964 if ($trace_tasks)
2314 0 0 unless print {$Marpa::PP::Internal::TRACE_FH;} 'Task: POPULATE_DEPTH; ', scalar @task_list, " tasks pending\n"
2338 13292 14758 unless defined $child_or_node_id
2344 14147 611 unless $$next_depth_or_node[5]
2358 217 3747 unless scalar @or_nodes_at_next_depth