| 1 |
|
| /* vi: set ft=c : */ |
| 2 |
|
| |
| 3 |
|
| #include "op_sibling_splice.c.inc" |
| 4 |
|
| |
| 5 |
|
| /* force_list_keeping_pushmark nulls out the OP_LIST itself but preserves |
| 6 |
|
| * the OP_PUSHMARK inside it. This is essential or else op_contextualize() |
| 7 |
|
| * will null out both of them and we lose the mark |
| 8 |
|
| */ |
| 9 |
|
| /* copypasta from core's op.c */ |
| 10 |
|
| #define force_list_keeping_pushmark(o) S_force_list_keeping_pushmark(aTHX_ o) |
| 11 |
39 |
| static OP *S_force_list_keeping_pushmark(pTHX_ OP *o) |
| 12 |
|
| { |
| 13 |
39 |
▶ | if(!o || o->op_type != OP_LIST) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(!o || o->op_type != OP_LIST) { |
39 |
0 |
39 |
| if(!o || o->op_type != OP_LIST) { |
28 |
11 |
39 |
|
| 14 |
28 |
| OP *rest = NULL; |
| 15 |
28 |
▶ | if(o) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(o) { |
28 |
0 |
28 |
|
| 16 |
28 |
▶ | rest = OpSIBLING(o); |
Branch: 1 branch
| Branch | True | False | Total |
| rest = OpSIBLING(o); |
0 |
28 |
28 |
|
| 17 |
28 |
| OpLASTSIB_set(o, NULL); |
| 18 |
|
| } |
| 19 |
28 |
| o = newLISTOP(OP_LIST, 0, o, NULL); |
| 20 |
28 |
▶ | if(rest) |
Branch: 1 branch
| Branch | True | False | Total |
| if(rest) |
0 |
28 |
28 |
|
| 21 |
0 |
| op_sibling_splice(o, cLISTOPo->op_last, 0, rest); |
| 22 |
|
| } |
| 23 |
39 |
| op_null(o); |
| 24 |
39 |
| return op_contextualize(o, G_LIST); |
| 25 |
|
| } |