Branch Coverage

src/parse_subsignature_ex.c
Criterion Covered Total %
branch 259 368 70.3


line true false branch
72 0 0 sv_catpvf(message, "%s at %s line %" IVdf,
75 0 0 if(context)
76 0 0 sv_catpvf(message, ", near \"%" UTF8f "\"",
0 0 sv_catpvf(message, ", near \"%" UTF8f "\"",
0 0 sv_catpvf(message, ", near \"%" UTF8f "\"",
0 0 sv_catpvf(message, ", near \"%" UTF8f "\"",
0 0 sv_catpvf(message, ", near \"%" UTF8f "\"",
104 15 0 if (first)
106 15 0 while (kid && OpHAS_SIBLING(kid))
0 15 while (kid && OpHAS_SIBLING(kid))
108 15 0 if (kid)
122 0 6 if (!cv)
126 0 6 if (!gv)
173 12 0 ok = TARG && !SvPADSTALE(TARG);
6 6 ok = TARG && !SvPADSTALE(TARG);
177 2 0 ok = TARG && SvOK(TARG);
1 1 ok = TARG && SvOK(TARG);
181 2 0 ok = TARG && SvTRUE(TARG);
1 1 ok = TARG && SvTRUE(TARG);
194 15 0 if(!sv || !SvROK(sv))
15 0 if(!sv || !SvROK(sv))
201 0 1 if(SvTYPE(rv) > SVt_PVMG)
206 1 10 if(SvTYPE(rv) != SVt_PVAV)
211 1 2 if(SvTYPE(rv) != SVt_PVHV)
246 0 50 if(UNLIKELY(TAINT_get) && !SvTAINTED(val))
0 0 if(UNLIKELY(TAINT_get) && !SvTAINTED(val))
0 0 if(UNLIKELY(TAINT_get) && !SvTAINTED(val))
249 5 45 if(flags & NAMEDPARAMf_REFALIAS) {
257 0 5 if(!check_refalias_arg(priv, val)) {
258 0 0 if(!name)
266 5 0 *padentry = SvREFCNT_inc(SvRV(val));
269 45 0 SvSetMagicSV(*padentry, val);
0 45 SvSetMagicSV(*padentry, val);
288 12 3 if(a->namehash < b->namehash)
290 12 0 if(a->namehash > b->namehash)
311 7 29 if(PL_op->op_targ) {
316 6 30 if(PL_op->op_private & OPpARGELEM_HV) {
317 5 1 if(PL_op->op_targ) {
326 3 27 else if(PL_op->op_private & OPpARGELEM_AV) {
327 2 1 if(PL_op->op_targ) {
346 52 36 for(parami = 0; parami < n_params; parami++) {
362 50 36 while(argix < argc) {
366 49 1 SV *val = argix < argc ? *av_fetch(defav, argix, 0) : &PL_sv_undef;
373 50 0 PERL_HASH(namehash, namepv, namelen);
384 68 5 for(parami = 0; parami < n_params; parami++) {
390 65 3 if(p->namehash > namehash)
392 23 42 if(p->namehash != namehash)
396 0 42 if(namelen != p->namelen)
398 0 42 if(!strnEQ(namepv, p->namepv, namelen))
405 42 8 if(param) {
408 1 7 else if(slurpy_hv) {
411 4 3 else if(slurpy_av) {
413 1 3 if(argix <= argc)
416 2 1 else if(!slurpy_ignore) {
417 1 0 if(!unrecognised_keynames) {
422 0 1 if(SvCUR(unrecognised_keynames))
429 1 35 if(n_unrecognised) {
430 1 0 croak_from_caller("Unrecognised %s %" SVf " for subroutine %" SVf,
438 51 35 for(parami = 0; parami < n_params; parami++) {
442 41 10 if(!SvPADSTALE(targ))
444 6 4 if(!(param->flags & NAMEDPARAMf_REQUIRED))
447 3 1 if(!missing_keynames) {
452 1 3 if(SvCUR(missing_keynames))
458 3 32 if(n_missing) {
459 2 1 croak_from_caller("Missing %s %" SVf " for subroutine %" SVf,
476 0 0 for(parami = 0; parami < aux->n_params; parami++) {
486 0 0 if(param->flags & NAMEDPARAMf_UTF8)
488 0 0 if(param->flags & NAMEDPARAMf_REQUIRED)
489 0 0 opdump_printf(ctx, "%sREQUIRED", need_comma?",":""), need_comma = true;
490 0 0 if(param->flags & NAMEDPARAMf_REFALIAS)
491 0 0 opdump_printf(ctx, "%sREFALIAS", need_comma?",":""), need_comma = true;
506 3 7 if(PL_op->op_flags & OPf_STACKED)
510 7 0 sv = svp ? *svp : NULL;
515 2 8 if(!check_refalias_arg(priv, sv)) {
530 8 0 *padentry = SvREFCNT_inc(SvRV(sv));
556 8 0 for(reg = sigattrs; reg; reg = reg->next) {
557 0 8 if(!strEQ(name, reg->name))
560 8 0 if(reg->funcs->permit_hintkey &&
8 0 if(reg->funcs->permit_hintkey &&
561 0 8 (!hints || !hv_fetch(hints, reg->funcs->permit_hintkey, reg->permit_hintkeylen, 0)))
582 0 8 if(p->funcs->free)
609 27 17 if(sigctx->named_details)
616 41 38 if(paramctx->is_named) {
619 41 0 if(paramctx->namelen) {
620 27 14 if(!sigctx->named_details)
631 4 37 if(paramctx->is_refalias) {
652 5 33 else if(paramctx->is_refalias) {
656 5 0 if(paramctx->op)
661 2 3 if(paramctx->defop)
664 27 6 else if(paramctx->sigil == '$') {
671 24 3 if(paramctx->op)
676 4 23 if(paramctx->defop)
683 4 2 if(paramctx->varop)
696 0 4 if(details->ver < 7 || details->ver > XSPARSESUBLIKE_ABI_VERSION)
720 3 1 if(details->sigil == '$')
753 63 13 if((flags & PARSE_SUBSIGNATURE_NAMED_PARAMS) && c == ':') {
41 22 if((flags & PARSE_SUBSIGNATURE_NAMED_PARAMS) && c == ':') {
761 29 47 if((flags & PARSE_SUBSIGNATURE_REFALIAS) && c == '\\') {
9 20 if((flags & PARSE_SUBSIGNATURE_REFALIAS) && c == '\\') {
773 63 13 if((flags & PARSE_SUBSIGNATURE_NAMED_PARAMS) && c == ':')
0 63 if((flags & PARSE_SUBSIGNATURE_NAMED_PARAMS) && c == ':')
794 76 0 if(isIDFIRST_uni(lex_peek_unichar(0))) {
76 0 if(isIDFIRST_uni(lex_peek_unichar(0))) {
70 6 if(isIDFIRST_uni(lex_peek_unichar(0))) {
0 0 if(isIDFIRST_uni(lex_peek_unichar(0))) {
796 126 0 while(isALNUM_uni(lex_peek_unichar(0)))
126 0 while(isALNUM_uni(lex_peek_unichar(0)))
56 70 while(isALNUM_uni(lex_peek_unichar(0)))
0 0 while(isALNUM_uni(lex_peek_unichar(0)))
806 41 29 if(paramctx.is_named) {
813 5 24 if(paramctx.is_refalias) {
828 8 68 if(lex_peek_unichar(0) == ':') {
829 0 8 if(!permit_attributes)
837 8 8 while(lex_scan_attrval_into(attrname, attrval)) {
843 8 0 if(reg->funcs->apply)
846 8 0 if(attrdata || reg->funcs->post_defop) {
8 0 if(attrdata || reg->funcs->post_defop) {
847 8 0 if(!pending) {
860 0 8 if(lex_peek_unichar(0) == ':') {
867 13 63 if(paramctx.sigil == '$' || paramctx.is_refalias) {
8 5 if(paramctx.sigil == '$' || paramctx.is_refalias) {
868 30 41 if(paramctx.is_named) {
871 0 30 if(sigctx->slurpy_sigil)
877 2 52 (default_if_undef = lex_consume("//=")) ||
880 0 19 if(PL_parser->error_count)
882 10 9 if(!paramctx.is_named && !paramctx.varop) {
4 6 if(!paramctx.is_named && !paramctx.varop) {
884 2 2 if(defexpr && defexpr->op_type != OP_UNDEF)
1 1 if(defexpr && defexpr->op_type != OP_UNDEF)
888 9 9 if(paramctx.is_named) {
892 1 8 if(paramctx.is_refalias) {
901 9 0 OP *existsop = (OP *)alloc_LOGOP(OP_CUSTOM, assignop, LINKLIST(assignop));
904 8 1 existsop->op_private =
7 1 existsop->op_private =
911 9 0 LINKLIST(defop);
919 6 3 else if(paramctx.varop) {
922 1 5 if(default_if_undef) private |= OPpARG_IF_UNDEF;
923 1 5 if(default_if_false) private |= OPpARG_IF_FALSE;
932 1 5 if(!defexpr)
935 2 4 OP *defop = (OP *)alloc_LOGOP(OP_ARGDEFELEM, defexpr, LINKLIST(defexpr));
943 6 0 LINKLIST(paramctx.varop);
954 0 52 if(sigctx->n_optelems)
957 20 32 if(!paramctx.is_named)
962 0 5 if(paramctx.is_named)
964 0 5 if(sigctx->slurpy_sigil)
967 0 5 if(lex_peek_unichar(0) == '=')
971 8 67 if(pending) {
972 0 16 for(int i = 0; i <= AvFILL(pending); i++) {
8 8 for(int i = 0; i <= AvFILL(pending); i++) {
975 8 0 if(p->funcs->post_defop)
997 44 0 if(ctx)
1009 50 44 FOREACH_HOOKS_FORWARD {
50 44 FOREACH_HOOKS_FORWARD {
1010 50 0 if(hooks->ver >= 7 && hooks->start_signature)
6 44 if(hooks->ver >= 7 && hooks->start_signature)
1014 76 1 while(lex_peek_unichar(0) != ')') {
1018 0 75 if(PL_parser->error_count) {
1039 43 0 if (!FEATURE_SIGNATURES_IS_ENABLED)
43 0 if (!FEATURE_SIGNATURES_IS_ENABLED)
43 0 if (!FEATURE_SIGNATURES_IS_ENABLED)
0 43 if (!FEATURE_SIGNATURES_IS_ENABLED)
1047 49 43 FOREACH_HOOKS_REVERSE {
49 43 FOREACH_HOOKS_REVERSE {
1048 49 0 if(hooks->ver >= 7 && hooks->finish_signature)
4 45 if(hooks->ver >= 7 && hooks->finish_signature)
1053 37 6 if(!slurpy_sigil && sigctx->named_details)
22 15 if(!slurpy_sigil && sigctx->named_details)
1066 27 16 if(sigctx->named_details) {
1067 0 27 UV n_params = HvKEYS(sigctx->named_details);
1080 41 27 while((iter = hv_iternext(sigctx->named_details))) {
1082 0 41 const char *namepv = HePV(iter, namelen);
1087 0 41 (HeUTF8(iter) ? NAMEDPARAMf_UTF8 : 0),
41 0 (HeUTF8(iter) ? NAMEDPARAMf_UTF8 : 0),
1096 13 14 if(aux->n_params > 1) {
1104 5 22 if(sigctx->slurpy_sigil) {
1105 3 2 if(sigctx->slurpy_elem && sigctx->slurpy_elem->op_type == OP_LINESEQ) {
3 0 if(sigctx->slurpy_elem && sigctx->slurpy_elem->op_type == OP_LINESEQ) {
1107 3 0 OP *o = OpSIBLING(cLISTOPx(sigctx->slurpy_elem)->op_first);
1120 1 1 argelems_named_op->op_private = (sigctx->slurpy_sigil == '%') ? OPpARGELEM_HV :
0 1 argelems_named_op->op_private = (sigctx->slurpy_sigil == '%') ? OPpARGELEM_HV :
1125 3 2 if(sigctx->slurpy_elem) {
1136 9 18 if(sigctx->named_elem_defops)
1141 1 15 else if(sigctx->slurpy_elem) {
1165 9 0 if(funcs->permit_hintkey)