| line |
true |
false |
branch |
|
63
|
0 |
412 |
if (c == -1) break; |
|
64
|
412 |
0 |
if (!isALNUM(c) && c != '_') break; |
|
|
133 |
279 |
if (!isALNUM(c) && c != '_') break; |
|
|
133 |
0 |
if (!isALNUM(c) && c != '_') break; |
|
68
|
1 |
132 |
if (SvCUR(buf) == 0) { SvREFCNT_dec(buf); return NULL; } |
|
79
|
0 |
11 |
if (c == -1) croak("let: unterminated string in pattern key"); |
|
80
|
0 |
11 |
if (c == '\\') { |
|
82
|
0 |
0 |
if (next == -1) croak("let: unterminated string in pattern key"); |
|
83
|
0 |
0 |
if (quote == '"') { |
|
92
|
0 |
0 |
if (next != '\\' && next != '\'') |
|
|
0 |
0 |
if (next != '\\' && next != '\'') |
|
96
|
1 |
10 |
} else if (c == quote) { |
|
110
|
16 |
92 |
if (c != '$' && c != '@' && c != '%') |
|
|
6 |
10 |
if (c != '$' && c != '@' && c != '%') |
|
|
0 |
6 |
if (c != '$' && c != '@' && c != '%') |
|
115
|
0 |
108 |
if (!id) croak("let: expected an identifier after '%c'", (int)*sigil); |
|
156
|
0 |
0 |
if (!SvROK(rv) || SvTYPE(SvRV(rv)) != SVt_PVAV) { |
|
|
0 |
0 |
if (!SvROK(rv) || SvTYPE(SvRV(rv)) != SVt_PVAV) { |
|
161
|
0 |
0 |
if (n < 0) n = 0; |
|
162
|
0 |
0 |
EXTEND(SP, top - n + 1); |
|
|
0 |
0 |
EXTEND(SP, top - n + 1); |
|
163
|
0 |
0 |
for (i = n; i <= top; i++) { |
|
165
|
0 |
0 |
PUSHs(el ? *el : &PL_sv_undef); |
|
193
|
5 |
0 |
SV *rv = nitems > 0 ? items[0] : &PL_sv_undef; |
|
199
|
4 |
1 |
if (!SvROK(rv) || SvTYPE(SvRV(rv)) != SVt_PVHV) { |
|
|
0 |
4 |
if (!SvROK(rv) || SvTYPE(SvRV(rv)) != SVt_PVHV) { |
|
210
|
3 |
1 |
Newx(keep, nexcl ? nexcl : 1, SV *); |
|
|
0 |
3 |
Newx(keep, nexcl ? nexcl : 1, SV *); |
|
|
3 |
1 |
Newx(keep, nexcl ? nexcl : 1, SV *); |
|
211
|
4 |
4 |
for (i = 0; i < nexcl; i++) keep[i] = excl[i]; |
|
214
|
0 |
4 |
EXTEND(SP, 2 * (IV)HvUSEDKEYS(hv)); |
|
|
4 |
0 |
EXTEND(SP, 2 * (IV)HvUSEDKEYS(hv)); |
|
|
0 |
4 |
EXTEND(SP, 2 * (IV)HvUSEDKEYS(hv)); |
|
|
0 |
4 |
EXTEND(SP, 2 * (IV)HvUSEDKEYS(hv)); |
|
|
0 |
0 |
EXTEND(SP, 2 * (IV)HvUSEDKEYS(hv)); |
|
216
|
10 |
4 |
while ((he = hv_iternext(hv))) { |
|
219
|
11 |
6 |
for (i = 0; i < nexcl; i++) { |
|
220
|
4 |
7 |
if (sv_eq(k, keep[i])) { skip = 1; break; } |
|
222
|
4 |
6 |
if (skip) continue; |
|
238
|
9 |
5 |
for (i = 0; i < pat->n; i++) { |
|
240
|
5 |
4 |
if (el->kind == DD_SLURPY) continue; |
|
241
|
4 |
0 |
if (el->key) |
|
265
|
31 |
99 |
if (shape == DD_HASH) { |
|
268
|
5 |
26 |
if (c == '%') { /* %rest: remaining keys */ |
|
275
|
25 |
1 |
if (c == '"' || c == '\'') |
|
|
0 |
25 |
if (c == '"' || c == '\'') |
|
279
|
1 |
24 |
if (!key) croak("let: expected a key in hash pattern"); |
|
284
|
24 |
1 |
if (lex_peek_unichar(0) != '=' || |
|
285
|
0 |
24 |
PL_parser->bufptr[1] != '>') |
|
295
|
114 |
9 |
if (c == '[' || c == '{') { |
|
|
4 |
110 |
if (c == '[' || c == '{') { |
|
304
|
93 |
17 |
if (DD_IS_ARRAYLIKE(shape) && (c == 'u')) { |
|
|
7 |
86 |
if (DD_IS_ARRAYLIKE(shape) && (c == 'u')) { |
|
306
|
7 |
0 |
if (strnEQ(PL_parser->bufptr, "undef", 5)) { |
|
308
|
7 |
0 |
if (!isALNUM(after) && after != '_') { |
|
|
7 |
0 |
if (!isALNUM(after) && after != '_') { |
|
310
|
35 |
7 |
for (i = 0; i < 5; i++) lex_read_unichar(0); |
|
322
|
93 |
10 |
if (sigil == '@' || sigil == '%') { |
|
|
1 |
92 |
if (sigil == '@' || sigil == '%') { |
|
329
|
10 |
82 |
if (c == '=' && PL_parser->bufptr[1] != '>') { |
|
|
10 |
0 |
if (c == '=' && PL_parser->bufptr[1] != '>') { |
|
343
|
48 |
29 |
if (open == '[') { pat->shape = DD_ARRAY; close = ']'; } |
|
344
|
20 |
9 |
else if (open == '{') { pat->shape = DD_HASH; close = '}'; } |
|
345
|
8 |
1 |
else if (open == '(') { pat->shape = DD_LIST; close = ')'; } |
|
350
|
73 |
3 |
if (lex_peek_unichar(0) == close) { lex_read_unichar(0); return; } |
|
355
|
0 |
130 |
if (pat->n >= DD_MAX_ELEMS) croak("let: too many pattern elements"); |
|
361
|
16 |
112 |
if (el->kind == DD_SLURPY) { |
|
363
|
1 |
15 |
if (lex_peek_unichar(0) != close) |
|
372
|
58 |
54 |
if (c == ',') { |
|
375
|
1 |
57 |
if (lex_peek_unichar(0) == close) { lex_read_unichar(0); return; } |
|
378
|
53 |
1 |
if (c == close) { lex_read_unichar(0); return; } |
|
396
|
0 |
49 |
if (sigil == '@') { lhs = newOP(OP_PADAV, 0); } |
|
397
|
5 |
44 |
else if (sigil == '%') { lhs = newOP(OP_PADHV, 0); } |
|
417
|
28 |
16 |
: dd_helem(aTHX_ src, el->key); |
|
418
|
10 |
34 |
if (el->deflt) { |
|
433
|
5 |
0 |
if (pat->shape == DD_HASH) { |
|
434
|
5 |
0 |
if (el->sigil == '%') |
|
446
|
64 |
39 |
for (i = 0; i < pat->n; i++) { |
|
469
|
6 |
7 |
: dd_helem(aTHX_ src, el->key); |
|
485
|
123 |
71 |
for (i = 0; i < pat->n; i++) { |
|
487
|
103 |
20 |
if (el->name) SvREFCNT_dec(el->name); |
|
488
|
23 |
100 |
if (el->key) SvREFCNT_dec(el->key); |
|
489
|
0 |
123 |
if (el->deflt) op_free(el->deflt); |
|
490
|
13 |
110 |
if (el->nested) { dd_free_pat(aTHX_ el->nested); Safefree(el->nested); } |
|
504
|
14 |
44 |
if (pat->shape == DD_HASH) return 0; |
|
505
|
75 |
32 |
for (i = 0; i < pat->n; i++) { |
|
507
|
55 |
20 |
if (el->kind == DD_SCALAR) { if (el->deflt) return 0; } |
|
|
8 |
47 |
if (el->kind == DD_SCALAR) { if (el->deflt) return 0; } |
|
508
|
14 |
6 |
else if (el->kind == DD_HOLE) { /* -> undef in the LHS list */ } |
|
509
|
10 |
4 |
else if (el->kind == DD_SLURPY) { if (i != pat->n - 1) return 0; } |
|
|
0 |
10 |
else if (el->kind == DD_SLURPY) { if (i != pat->n - 1) return 0; } |
|
520
|
59 |
32 |
for (i = 0; i < pat->n; i++) { |
|
523
|
5 |
54 |
if (el->kind == DD_HOLE) { |
|
529
|
9 |
45 |
if (sigil == '@') v = newOP(OP_PADAV, 0); |
|
530
|
1 |
44 |
else if (sigil == '%') v = newOP(OP_PADHV, 0); |