| line |
true |
false |
branch |
|
53
|
0 |
62 |
if (c == -1) break; |
|
54
|
62 |
0 |
if (!isALNUM(c) && c != '_') break; |
|
|
19 |
43 |
if (!isALNUM(c) && c != '_') break; |
|
|
19 |
0 |
if (!isALNUM(c) && c != '_') break; |
|
58
|
0 |
19 |
if (SvCUR(buf) == 0) { SvREFCNT_dec(buf); return NULL; } |
|
69
|
0 |
0 |
if (c == -1) croak("let: unterminated string in pattern key"); |
|
70
|
0 |
0 |
if (c == '\\') { |
|
72
|
0 |
0 |
if (next == -1) croak("let: unterminated string in pattern key"); |
|
73
|
0 |
0 |
if (quote == '"') { |
|
82
|
0 |
0 |
if (next != '\\' && next != '\'') |
|
|
0 |
0 |
if (next != '\\' && next != '\'') |
|
86
|
0 |
0 |
} else if (c == quote) { |
|
100
|
2 |
13 |
if (c != '$' && c != '@' && c != '%') |
|
|
1 |
1 |
if (c != '$' && c != '@' && c != '%') |
|
|
0 |
1 |
if (c != '$' && c != '@' && c != '%') |
|
105
|
0 |
15 |
if (!id) croak("let: expected an identifier after '%c'", (int)*sigil); |
|
146
|
0 |
0 |
if (!SvROK(rv) || SvTYPE(SvRV(rv)) != SVt_PVAV) { |
|
|
0 |
0 |
if (!SvROK(rv) || SvTYPE(SvRV(rv)) != SVt_PVAV) { |
|
151
|
0 |
0 |
if (n < 0) n = 0; |
|
152
|
0 |
0 |
EXTEND(SP, top - n + 1); |
|
|
0 |
0 |
EXTEND(SP, top - n + 1); |
|
153
|
0 |
0 |
for (i = n; i <= top; i++) { |
|
155
|
0 |
0 |
PUSHs(el ? *el : &PL_sv_undef); |
|
183
|
1 |
0 |
SV *rv = nitems > 0 ? items[0] : &PL_sv_undef; |
|
189
|
1 |
0 |
if (!SvROK(rv) || SvTYPE(SvRV(rv)) != SVt_PVHV) { |
|
|
0 |
1 |
if (!SvROK(rv) || SvTYPE(SvRV(rv)) != SVt_PVHV) { |
|
200
|
1 |
0 |
Newx(keep, nexcl ? nexcl : 1, SV *); |
|
|
0 |
1 |
Newx(keep, nexcl ? nexcl : 1, SV *); |
|
|
1 |
0 |
Newx(keep, nexcl ? nexcl : 1, SV *); |
|
201
|
1 |
1 |
for (i = 0; i < nexcl; i++) keep[i] = excl[i]; |
|
204
|
0 |
1 |
EXTEND(SP, 2 * (IV)HvUSEDKEYS(hv)); |
|
|
1 |
0 |
EXTEND(SP, 2 * (IV)HvUSEDKEYS(hv)); |
|
|
0 |
1 |
EXTEND(SP, 2 * (IV)HvUSEDKEYS(hv)); |
|
|
0 |
1 |
EXTEND(SP, 2 * (IV)HvUSEDKEYS(hv)); |
|
|
0 |
0 |
EXTEND(SP, 2 * (IV)HvUSEDKEYS(hv)); |
|
206
|
3 |
1 |
while ((he = hv_iternext(hv))) { |
|
209
|
3 |
2 |
for (i = 0; i < nexcl; i++) { |
|
210
|
1 |
2 |
if (sv_eq(k, keep[i])) { skip = 1; break; } |
|
212
|
1 |
2 |
if (skip) continue; |
|
228
|
2 |
1 |
for (i = 0; i < pat->n; i++) { |
|
230
|
1 |
1 |
if (el->kind == DD_SLURPY) continue; |
|
231
|
1 |
0 |
if (el->key) |
|
255
|
5 |
13 |
if (shape == DD_HASH) { |
|
258
|
1 |
4 |
if (c == '%') { /* %rest: remaining keys */ |
|
265
|
4 |
0 |
if (c == '"' || c == '\'') |
|
|
0 |
4 |
if (c == '"' || c == '\'') |
|
269
|
0 |
4 |
if (!key) croak("let: expected a key in hash pattern"); |
|
274
|
4 |
0 |
if (lex_peek_unichar(0) != '=' || |
|
275
|
0 |
4 |
PL_parser->bufptr[1] != '>') |
|
285
|
15 |
2 |
if (c == '[' || c == '{') { |
|
|
0 |
15 |
if (c == '[' || c == '{') { |
|
294
|
13 |
2 |
if (DD_IS_ARRAYLIKE(shape) && (c == 'u')) { |
|
|
1 |
12 |
if (DD_IS_ARRAYLIKE(shape) && (c == 'u')) { |
|
296
|
1 |
0 |
if (strnEQ(PL_parser->bufptr, "undef", 5)) { |
|
298
|
1 |
0 |
if (!isALNUM(after) && after != '_') { |
|
|
1 |
0 |
if (!isALNUM(after) && after != '_') { |
|
300
|
5 |
1 |
for (i = 0; i < 5; i++) lex_read_unichar(0); |
|
312
|
13 |
1 |
if (sigil == '@' || sigil == '%') { |
|
|
0 |
13 |
if (sigil == '@' || sigil == '%') { |
|
319
|
1 |
12 |
if (c == '=' && PL_parser->bufptr[1] != '>') { |
|
|
1 |
0 |
if (c == '=' && PL_parser->bufptr[1] != '>') { |
|
333
|
7 |
3 |
if (open == '[') { pat->shape = DD_ARRAY; close = ']'; } |
|
334
|
3 |
0 |
else if (open == '{') { pat->shape = DD_HASH; close = '}'; } |
|
335
|
0 |
0 |
else if (open == '(') { pat->shape = DD_LIST; close = ')'; } |
|
340
|
10 |
0 |
if (lex_peek_unichar(0) == close) { lex_read_unichar(0); return; } |
|
345
|
0 |
18 |
if (pat->n >= DD_MAX_ELEMS) croak("let: too many pattern elements"); |
|
351
|
2 |
16 |
if (el->kind == DD_SLURPY) { |
|
353
|
0 |
2 |
if (lex_peek_unichar(0) != close) |
|
362
|
8 |
8 |
if (c == ',') { |
|
365
|
0 |
8 |
if (lex_peek_unichar(0) == close) { lex_read_unichar(0); return; } |
|
368
|
8 |
0 |
if (c == close) { lex_read_unichar(0); return; } |
|
386
|
0 |
7 |
if (sigil == '@') { lhs = newOP(OP_PADAV, 0); } |
|
387
|
1 |
6 |
else if (sigil == '%') { lhs = newOP(OP_PADHV, 0); } |
|
407
|
4 |
2 |
: dd_helem(aTHX_ src, el->key); |
|
408
|
1 |
5 |
if (el->deflt) { |
|
423
|
1 |
0 |
if (pat->shape == DD_HASH) { |
|
424
|
1 |
0 |
if (el->sigil == '%') |
|
436
|
10 |
6 |
for (i = 0; i < pat->n; i++) { |
|
459
|
0 |
2 |
: dd_helem(aTHX_ src, el->key); |
|
475
|
18 |
10 |
for (i = 0; i < pat->n; i++) { |
|
477
|
15 |
3 |
if (el->name) SvREFCNT_dec(el->name); |
|
478
|
4 |
14 |
if (el->key) SvREFCNT_dec(el->key); |
|
479
|
0 |
18 |
if (el->deflt) op_free(el->deflt); |
|
480
|
2 |
16 |
if (el->nested) { dd_free_pat(aTHX_ el->nested); Safefree(el->nested); } |
|
494
|
3 |
5 |
if (pat->shape == DD_HASH) return 0; |
|
495
|
9 |
5 |
for (i = 0; i < pat->n; i++) { |
|
497
|
8 |
1 |
if (el->kind == DD_SCALAR) { if (el->deflt) return 0; } |
|
|
0 |
8 |
if (el->kind == DD_SCALAR) { if (el->deflt) return 0; } |
|
498
|
1 |
0 |
else if (el->kind == DD_HOLE) { /* -> undef in the LHS list */ } |
|
499
|
1 |
0 |
else if (el->kind == DD_SLURPY) { if (i != pat->n - 1) return 0; } |
|
|
0 |
1 |
else if (el->kind == DD_SLURPY) { if (i != pat->n - 1) return 0; } |
|
510
|
8 |
4 |
for (i = 0; i < pat->n; i++) { |
|
513
|
0 |
8 |
if (el->kind == DD_HOLE) { |
|
519
|
1 |
7 |
if (sigil == '@') v = newOP(OP_PADAV, 0); |
|
520
|
0 |
7 |
else if (sigil == '%') v = newOP(OP_PADHV, 0); |