summaryrefslogtreecommitdiff
path: root/copy.c
diff options
context:
space:
mode:
Diffstat (limited to 'copy.c')
-rw-r--r--copy.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/copy.c b/copy.c
index 8b3db68..0a034f6 100644
--- a/copy.c
+++ b/copy.c
@@ -304,6 +304,17 @@ 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:
+ if (in->flags & STMT_TYPED) {
+ size_t nstmts = arr_len(in->inc.stmts);
+ arr_set_lena(&out->inc.stmts, nstmts, c->allocr);
+ for (size_t i = 0; i < nstmts; ++i) {
+ copy_stmt(c, &out->inc.stmts[i], &in->inc.stmts[i]);
+ }
+ } else {
+ copy_expr(c, &out->inc.filename, &in->inc.filename);
+ }
+ break;
case STMT_EXPR:
copy_expr(c, &out->expr, &in->expr);
break;