summaryrefslogtreecommitdiff
path: root/copy.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-07-03 16:09:10 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-07-03 16:09:10 -0400
commit119950ebde3c9f096d1866ba6448d6bd9b22d063 (patch)
tree35e6bb7a2507910ac784356baf25c2412b6959b6 /copy.c
parentb25f392b221cea498ea7695f68828909734b51cd (diff)
removed ability to evaluate a function before it is declared at compile time; that was causing too many problems
Diffstat (limited to 'copy.c')
-rw-r--r--copy.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/copy.c b/copy.c
index 0adce52..b6716f5 100644
--- a/copy.c
+++ b/copy.c
@@ -348,6 +348,11 @@ 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;
@@ -417,14 +422,9 @@ 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: {
- size_t nstmts = arr_len(in->inline_block);
- out->inline_block = NULL;
- 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;
+ case STMT_INLINE_BLOCK:
+ assert(0); /* only exists after typing */
+ break;
}
}