summaryrefslogtreecommitdiff
path: root/copy.c
diff options
context:
space:
mode:
Diffstat (limited to 'copy.c')
-rw-r--r--copy.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/copy.c b/copy.c
index b6716f5..e96b2ac 100644
--- a/copy.c
+++ b/copy.c
@@ -348,11 +348,6 @@ static void copy_stmt(Copier *c, Statement *out, Statement *in) {
if (in->ret->flags & RET_HAS_EXPR)
copy_expr(c, &out->ret->expr, &in->ret->expr);
break;
- case STMT_INCLUDE:
- out->inc = copier_malloc(c, sizeof *out->inc);
- *out->inc = *in->inc;
- copy_expr(c, &out->inc->filename, &in->inc->filename);
- break;
case STMT_EXPR:
out->expr = copy_expr_(c, in->expr);
break;
@@ -422,9 +417,13 @@ static void copy_stmt(Copier *c, Statement *out, Statement *in) {
case STMT_BLOCK:
copy_block(c, out->block = copier_malloc(c, sizeof *out->block), in->block, 0);
break;
- case STMT_INLINE_BLOCK:
- assert(0); /* only exists after typing */
- break;
+ case STMT_INLINE_BLOCK: {
+ size_t nstmts = arr_len(in->inline_block);
+ arr_set_lena(out->inline_block, nstmts, c->allocr);
+ for (size_t i = 0; i < nstmts; ++i) {
+ copy_stmt(c, &out->inline_block[i], &in->inline_block[i]);
+ }
+ } break;
}
}