summaryrefslogtreecommitdiff
path: root/com.c
diff options
context:
space:
mode:
Diffstat (limited to 'com.c')
-rw-r--r--com.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/com.c b/com.c
index cd097df..dbf07a4 100644
--- a/com.c
+++ b/com.c
@@ -712,14 +712,15 @@ int main(int argc, char **argv) {
exit(1);
}
- AstNode an;
- memset(&an, 0, sizeof an);
+ AstNode an = { 0 };
+ AstNode top = astnode_new_list();
pcc_context_t *parser = pcc_create(infile);
while (pcc_parse(parser, &an)) {
- compile_node(&com, an, 0);
- astnode_free(&an);
+ astnode_append(&top, an);
}
pcc_destroy(parser);
+ compile_body(&com, top.as.list, 0, 0);
+ astnode_free(&top);
}