Branch Coverage

lib/XS/Parse/Sublike.xs
Criterion Covered Total %
branch 164 222 73.8


line true false branch
97 53 50 FOREACH_HOOKS_FORWARD {
53 50 FOREACH_HOOKS_FORWARD {
100 51 2 if(!(hooks->flags & XS_PARSE_SUBLIKE_FLAG_BODY_OPTIONAL))
102 4 49 if(hooks->flags & XS_PARSE_SUBLIKE_COMPAT_FLAG_DYNAMIC_ACTIONS)
106 49 1 if(!(skip_parts & XS_PARSE_SUBLIKE_PART_NAME)) {
110 4 46 if((require_parts & XS_PARSE_SUBLIKE_PART_NAME) && !ctx.name)
1 3 if((require_parts & XS_PARSE_SUBLIKE_PART_NAME) && !ctx.name)
114 9 40 ctx.actions = ctx.name
118 52 49 FOREACH_HOOKS_FORWARD {
52 49 FOREACH_HOOKS_FORWARD {
119 14 38 if(hooks->pre_subparse)
129 45 4 if(!have_dynamic_actions) {
130 36 9 if(ctx.name)
137 9 40 if(ctx.actions & XS_PARSE_SUBLIKE_ACTION_CVf_ANON)
147 48 1 if(!(skip_parts & XS_PARSE_SUBLIKE_PART_ATTRS) && (lex_peek_unichar(0) == ':')) {
4 44 if(!(skip_parts & XS_PARSE_SUBLIKE_PART_ATTRS) && (lex_peek_unichar(0) == ':')) {
156 4 4 if(!lex_scan_attrval_into(attr, val))
159 0 4 if(lex_peek_unichar(0) == ':') {
166 4 4 FOREACH_HOOKS_FORWARD {
4 4 FOREACH_HOOKS_FORWARD {
167 1 3 if((hooks->flags & XS_PARSE_SUBLIKE_FLAG_FILTERATTRS) && (hooks->filter_attr))
1 0 if((hooks->flags & XS_PARSE_SUBLIKE_FLAG_FILTERATTRS) && (hooks->filter_attr))
171 1 3 if(handled) {
177 0 3 if(strEQ(SvPVX(attr), "lvalue")) {
182 1 2 if(SvPOK(val))
193 52 49 FOREACH_HOOKS_FORWARD {
52 49 FOREACH_HOOKS_FORWARD {
194 11 41 if(hooks->post_blockstart)
206 48 1 if(!(skip_parts & XS_PARSE_SUBLIKE_PART_SIGNATURE) && (lex_peek_unichar(0) == '(')) {
22 26 if(!(skip_parts & XS_PARSE_SUBLIKE_PART_SIGNATURE) && (lex_peek_unichar(0) == '(')) {
210 22 0 if(require_parts & XS_PARSE_SUBLIKE_PART_SIGNATURE) {
254 23 22 FOREACH_HOOKS_FORWARD {
23 22 FOREACH_HOOKS_FORWARD {
255 10 13 if(hooks->flags & XS_PARSE_SUBLIKE_FLAG_SIGNATURE_NAMED_PARAMS)
257 5 18 if(hooks->flags & XS_PARSE_SUBLIKE_FLAG_SIGNATURE_PARAM_ATTRIBUTES)
261 11 11 if(flags)
266 0 22 if(PL_parser->error_count) {
273 0 22 if(lex_peek_unichar(0) != ')')
280 45 4 if(lex_peek_unichar(0) == '{') {
285 3 1 else if(require_parts & XS_PARSE_SUBLIKE_PART_BODY)
287 0 1 else if(lex_peek_unichar(0) == ';') {
294 45 1 if(ctx.body && sigop) {
22 23 if(ctx.body && sigop) {
298 6 16 if (ctx.body->op_type == OP_STUB) {
306 0 46 if(PL_parser->error_count) {
320 0 0 while(PL_scopestack_ix > was_scopestack_ix)
324 0 0 if(ctx.name) {
337 49 46 FOREACH_HOOKS_REVERSE {
49 46 FOREACH_HOOKS_REVERSE {
338 13 36 if(hooks->pre_blockend)
348 45 1 if(ctx.body) {
351 41 4 if(!have_dynamic_actions) {
352 33 8 if(ctx.name)
364 37 8 if(ctx.name && action_set_cvname && action_install_symbol)
36 1 if(ctx.name && action_set_cvname && action_install_symbol)
367 0 45 if(!nameop && action_install_symbol)
372 1 44 if(!nameop && action_set_cvname) {
375 1 0 const char *name = SvPV_const(ctx.name, namelen);
386 1 0 CvNAME_HEK_set(ctx.cv,
395 49 46 FOREACH_HOOKS_FORWARD {
49 46 FOREACH_HOOKS_FORWARD {
396 12 37 if(hooks->post_newcv)
403 42 4 if(!have_dynamic_actions) {
404 8 34 if(!ctx.name)
410 36 10 if(!(ctx.actions & XS_PARSE_SUBLIKE_ACTION_REFGEN_ANONCODE)) {
420 42 4 if(!have_dynamic_actions) {
421 8 34 if(!ctx.name)
427 36 10 return (ctx.actions & XS_PARSE_SUBLIKE_ACTION_RET_EXPR) ? KEYWORD_PLUGIN_EXPR : KEYWORD_PLUGIN_STMT;
471 28 9 if(reg->hooks->permit_hintkey)
476 27 10 if(!reg->hooks->permit && !reg->hooks->permit_hintkey)
0 27 if(!reg->hooks->permit && !reg->hooks->permit_hintkey)
503 48217 28419 for(reg = registrations; reg; reg = reg->next) {
504 3967 44250 if(reg->kwlen != kwlen || !strEQ(reg->kw, kw))
3913 54 if(reg->kwlen != kwlen || !strEQ(reg->kw, kw))
507 37 17 if(reg->hooks->permit_hintkey &&
37 0 if(reg->hooks->permit_hintkey &&
508 1 36 (!hints || !hv_fetch(hints, reg->hooks->permit_hintkey, reg->permit_hintkey_len, 0)))
524 1 0 if(!kwsv || !SvCUR(kwsv))
0 1 if(!kwsv || !SvCUR(kwsv))
527 1 0 const char *kw = SvPV_nolen(kwsv);
534 0 1 if(kwlen != 3 || !strEQ(kw, "sub")) {
0 0 if(kwlen != 3 || !strEQ(kw, "sub")) {
0 0 if(kwlen != 3 || !strEQ(kw, "sub")) {
0 0 if(kwlen != 3 || !strEQ(kw, "sub")) {
0 0 if(kwlen != 3 || !strEQ(kw, "sub")) {
536 0 1 if(!reg)
537 0 0 croak("Expected a keyword to introduce a sub or sub-like construction, found " QUOTED_PVNf,
0 0 croak("Expected a keyword to introduce a sub or sub-like construction, found " QUOTED_PVNf,
548 1 0 if(reg) {
553 0 1 return parse(aTHX_ hd, 1 + !!reg, op_ptr);
563 0 6 if(funcs->ver < 5)
566 0 6 if(funcs->ver > XSPARSESUBLIKE_ABI_VERSION)
570 6 0 if(!name || !(name[0] >= 'A' && name[0] <= 'Z'))
0 6 if(!name || !(name[0] >= 'A' && name[0] <= 'Z'))
573 0 6 if(!funcs->permit_hintkey)
603 28419 49 if(!reg)
620 7 44 while(hooks->flags & XS_PARSE_SUBLIKE_FLAG_PREFIX) {
625 7 0 if(!kwsv || !SvCUR(kwsv))
0 7 if(!kwsv || !SvCUR(kwsv))
628 7 0 kw = SvPV_nolen(kwsv);
634 5 2 if(kwlen == 3 && strEQ(kw, "sub"))
5 0 if(kwlen == 3 && strEQ(kw, "sub"))
5 0 if(kwlen == 3 && strEQ(kw, "sub"))
5 0 if(kwlen == 3 && strEQ(kw, "sub"))
0 5 if(kwlen == 3 && strEQ(kw, "sub"))
638 0 2 if(!reg)
639 0 0 croak("Expected a keyword to introduce a sub or sub-like construction, found " QUOTED_PVNf,
0 0 croak("Expected a keyword to introduce a sub or sub-like construction, found " QUOTED_PVNf,
644 0 2 if(SvLEN(hdlsv) < (nhooks + 1) * sizeof(struct HooksAndData)) {
645 0 0 SvGROW(hdlsv, SvLEN(hdlsv) * 2);
0 0 SvGROW(hdlsv, SvLEN(hdlsv) * 2);