aboutsummaryrefslogtreecommitdiff
path: root/tomo.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-07-23 19:46:42 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-07-23 19:46:42 -0400
commit87785555eca3b7166d5f1af658a08f58a64340ed (patch)
tree96ea3e32d371c56a0c392f9935785d841dcca30c /tomo.c
parent09ea357f46784b61886ef28b54fded632509b273 (diff)
Fix for order of operations issues with enum and function typedef code
Diffstat (limited to 'tomo.c')
-rw-r--r--tomo.c8
1 files changed, 5 insertions, 3 deletions
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);
}
}