Branch Coverage

Declare.xs
Criterion Covered Total %
branch 203 262 77.4


line true false branch
18 0 1743 if (c == -1) break;
19 1743 0 if (!isALNUM(c) && c != '_') break;
286 1457 if (!isALNUM(c) && c != '_') break;
286 0 if (!isALNUM(c) && c != '_') break;
23 0 286 if (SvCUR(buf) == 0) {
36 0 69 if (c == -1) break;
37 69 0 if (isALNUM(c) || c == '_') {
11 58 if (isALNUM(c) || c == '_') {
0 11 if (isALNUM(c) || c == '_') {
40 1 10 } else if (c == ':' && PL_parser->bufptr[0] == ':'
1 0 } else if (c == ':' && PL_parser->bufptr[0] == ':'
41 1 0 && PL_parser->bufptr[1] == ':') {
47 1 9 if (SvCUR(buf) == 0) {
59 75 4 if (c == '-' || c == '+') {
1 74 if (c == '-' || c == '+') {
65 114 69 if (c >= '0' && c <= '9') { seen_digit = 1; }
100 14 if (c >= '0' && c <= '9') { seen_digit = 1; }
66 4 79 else if (c == '.' && !seen_dot) {
4 0 else if (c == '.' && !seen_dot) {
69 4 0 char next = (PL_parser->bufptr[0] == '.') ? PL_parser->bufptr[1] : '\0';
70 3 1 if (next < '0' || next > '9') break;
3 0 if (next < '0' || next > '9') break;
73 78 1 else if ((c == 'e' || c == 'E') && seen_digit) {
0 78 else if ((c == 'e' || c == 'E') && seen_digit) {
1 0 else if ((c == 'e' || c == 'E') && seen_digit) {
77 1 0 if (c == '-' || c == '+') {
0 1 if (c == '-' || c == '+') {
87 0 79 if (!seen_digit) {
101 1 192 if (c == -1) croak("switch: unterminated string in case pattern");
102 2 190 if (c == '\\') {
104 0 2 if (next == -1) croak("switch: unterminated string in case pattern");
105 1 1 if (quote == '"') {
115 1 0 if (next != '\\' && next != '\'')
1 0 if (next != '\\' && next != '\'')
119 74 116 } else if (c == quote) {
143 136 53 if (t->kind == SDT_CONST)
177 80 74 if (c == '"' || c == '\'') {
1 79 if (c == '"' || c == '\'') {
181 74 5 if ((c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.') {
0 74 if ((c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.') {
1 4 if ((c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.') {
0 1 if ((c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.') {
0 0 if ((c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.') {
191 78 74 return newBINOP(is_num ? numop : strop, 0, sd_topic(aTHX_ t), konst);
212 14 153 if (c == '/') {
221 1 84 if (c == -1) croak("switch: unterminated regex in case pattern");
222 5 79 if (c == '\\') {
224 0 5 if (n == -1) croak("switch: unterminated regex in case pattern");
229 13 66 if (c == '/') break;
232 8 12 while (isALPHA((c = lex_peek_unichar(0)))) {
256 11 142 if (c == '\\') {
261 1 10 if (lex_peek_unichar(0) != '&')
265 1 9 if (!name) croak("switch: expected sub name after '\\&'");
273 18 124 if (c == '[') {
280 10 8 if (lex_peek_unichar(0) == '.') {
285 1 9 if (lex_peek_unichar(0) != '.')
291 0 9 if (lex_peek_unichar(0) != ']')
305 15 7 if (lex_peek_unichar(0) == ',') lex_read_unichar(0);
307 8 14 if (lex_peek_unichar(0) == ']') { lex_read_unichar(0); break; }
317 113 11 if (isALPHA(c) || c == '_') {
0 113 if (isALPHA(c) || c == '_') {
319 11 0 int is_sub = word && strEQ(SvPV_nolen(word), "sub");
11 0 int is_sub = word && strEQ(SvPV_nolen(word), "sub");
320 11 0 if (word) SvREFCNT_dec(word);
321 11 0 if (is_sub) {
325 1 10 if (lex_peek_unichar(0) != '{')
340 65 47 if (!is_num) {
354 0 309 if (!o) return 0;
355 0 309 if (o->op_private & OPpLVAL_INTRO) return 1;
356 24 285 if (o->op_flags & OPf_KIDS) {
357 28 24 for (kid = cUNOPx(o)->op_first; kid; kid = OpSIBLING(kid))
52 24 for (kid = cUNOPx(o)->op_first; kid; kid = OpSIBLING(kid))
358 0 52 if (sd_has_intro(aTHX_ kid)) return 1;
369 264 0 if (block->op_type == OP_LINESEQ) {
371 264 0 if (first
372 0 264 && (first->op_type == OP_NEXTSTATE || first->op_type == OP_DBSTATE)
0 0 && (first->op_type == OP_NEXTSTATE || first->op_type == OP_DBSTATE)
373 264 0 && OpSIBLING(first) && !OpSIBLING(OpSIBLING(first))
264 0 && OpSIBLING(first) && !OpSIBLING(OpSIBLING(first))
264 0 && OpSIBLING(first) && !OpSIBLING(OpSIBLING(first))
7 257 && OpSIBLING(first) && !OpSIBLING(OpSIBLING(first))
7 0 && OpSIBLING(first) && !OpSIBLING(OpSIBLING(first))
0 7 && OpSIBLING(first) && !OpSIBLING(OpSIBLING(first))
374 257 0 && !sd_has_intro(aTHX_ OpSIBLING(first))) {
257 0 && !sd_has_intro(aTHX_ OpSIBLING(first))) {
375 257 0 OP *expr = OpSIBLING(first);
415 1 119 if (lex_peek_unichar(0) != '(')
420 0 119 if (lex_peek_unichar(0) != ')')
430 13 106 if (scrutinee->op_type == OP_PADSV
431 13 0 && !(scrutinee->op_private & OPpLVAL_INTRO)) {
437 94 12 else if (scrutinee->op_type == OP_CONST) {
456 0 119 if (lex_peek_unichar(0) != '{')
464 108 275 if (c == '}') { lex_read_unichar(0); break; }
465 0 275 if (c == -1) croak("switch: unexpected end of input in switch body");
468 0 275 if (!kw) croak("switch: expected 'case' or 'default'");
470 168 107 if (strEQ(SvPV_nolen(kw), "case")) {
474 1 167 if (default_block)
476 0 167 if (narms >= MAX_ARMS)
481 1 159 if (lex_peek_unichar(0) != '{')
489 139 20 ? ((SVOP *)blk)->op_sv : NULL;
491 65 94 if (!pat.key || !vals[narms]) dispatchable = 0;
13 52 if (!pat.key || !vals[narms]) dispatchable = 0;
494 106 1 else if (strEQ(SvPV_nolen(kw), "default")) {
495 1 105 if (default_block)
498 0 105 if (lex_peek_unichar(0) != '{')
513 3 105 if (narms == 0 && !default_block)
1 2 if (narms == 0 && !default_block)
521 21 86 if (dispatchable && narms >= SD_DISPATCH_MIN) {
7 14 if (dispatchable && narms >= SD_DISPATCH_MIN) {
527 7 0 HV *hv = GvHVn(gv);
529 28 6 for (i = 0; i < narms; i++) {
532 1 27 if (hv_exists(hv, kpv, klen)) { dup = 1; break; }
533 0 27 if (!SvOK(vals[i])) any_undef = 1;
536 1 6 if (dup) {
540 1 5 : newOP(OP_UNDEF, 0);
541 0 6 if (any_undef) {
551 25 6 for (i = 0; i < narms; i++) { op_free(conds[i]); op_free(blocks[i]); }
556 101 6 if (!chain) {
558 3 98 : newOP(OP_UNDEF, 0);
559 133 101 for (i = narms - 1; i >= 0; i--)
563 158 107 for (i = 0; i < narms; i++)
564 65 93 if (keys[i]) SvREFCNT_dec(keys[i]);
566 95 12 if (topic.kind != SDT_TEMP) {
567 82 13 if (topic.kind == SDT_CONST) SvREFCNT_dec(topic.sv);
568 90 5 if (all_simple)
603 0 123 if (!hints) return 0;
605 120 3 return ent && SvTRUE(*ent);
120 0 return ent && SvTRUE(*ent);
609 13811 72003 if (kwlen == 6 && memEQ(kw, "switch", 6) && sd_in_scope(aTHX)) {
123 13688 if (kwlen == 6 && memEQ(kw, "switch", 6) && sd_in_scope(aTHX)) {
120 3 if (kwlen == 6 && memEQ(kw, "switch", 6) && sd_in_scope(aTHX)) {