From 4291b36e2c6ad65e14d775fcb34077dccb415edc Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 6 Sep 2024 14:50:00 -0400 Subject: Fix header compilation --- tomo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tomo.c b/tomo.c index d30afc14..5a2216a8 100644 --- a/tomo.c +++ b/tomo.c @@ -211,13 +211,13 @@ int main(int argc, char *argv[]) const char *filename = argv[i]; ast_t *ast = parse_file(filename, NULL); if (!ast) errx(1, "Could not parse file %s", filename); - env->namespace = new(namespace_t, .name=file_base_name(filename)); + env_t *module_env = load_module_env(env, ast); for (ast_list_t *stmt = Match(ast, Block)->statements; stmt; stmt = stmt->next) { - CORD h = compile_statement_typedefs(env, stmt->ast); + CORD h = compile_statement_typedefs(&module_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); + CORD h = compile_statement_definitions(&module_env, stmt->ast); if (h) CORD_put(h, header_prog); } fprintf(header_prog, "void %s$%s$$initialize(void);\n", libname, file_base_name(filename)); -- cgit v1.2.3