From 87785555eca3b7166d5f1af658a08f58a64340ed Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 23 Jul 2024 19:46:42 -0400 Subject: Fix for order of operations issues with enum and function typedef code --- tomo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tomo.c') diff --git a/tomo.c b/tomo.c index f6030577..631192e4 100644 --- a/tomo.c +++ b/tomo.c @@ -209,9 +209,11 @@ int main(int argc, char *argv[]) if (!ast) errx(1, "Could not parse file %s", filename); env->namespace = new(namespace_t, .name=file_base_name(filename)); for (ast_list_t *stmt = Match(ast, Block)->statements; stmt; stmt = stmt->next) { - if (stmt->ast->tag == Import || (stmt->ast->tag == Declare && Match(stmt->ast, Declare)->value->tag == Import)) - continue; - CORD h = compile_statement_header(env, stmt->ast); + CORD h = compile_statement_typedefs(env, stmt->ast); + if (h) CORD_put(h, header_prog); + } + for (ast_list_t *stmt = Match(ast, Block)->statements; stmt; stmt = stmt->next) { + CORD h = compile_statement_definitions(env, stmt->ast); if (h) CORD_put(h, header_prog); } } -- cgit v1.2.3