diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-07-23 19:46:42 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-07-23 19:46:42 -0400 |
| commit | 87785555eca3b7166d5f1af658a08f58a64340ed (patch) | |
| tree | 96ea3e32d371c56a0c392f9935785d841dcca30c /tomo.c | |
| parent | 09ea357f46784b61886ef28b54fded632509b273 (diff) | |
Fix for order of operations issues with enum and function typedef code
Diffstat (limited to 'tomo.c')
| -rw-r--r-- | tomo.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); } } |
