diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-06-16 18:09:54 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-06-16 18:09:54 -0400 |
| commit | 32e82fdbe333a5a2dbaab2b229f0540d0f9d812e (patch) | |
| tree | 12d89ae3190021ba7290c5afb4c9ba95b9d604de /typecheck.c | |
| parent | 9f8be0c5029a69bfa9796ac31866658b9da70390 (diff) | |
Remove some dead code and support -l as a tomo flag
Diffstat (limited to 'typecheck.c')
| -rw-r--r-- | typecheck.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/typecheck.c b/typecheck.c index 4b4f1038..f7f4ccc7 100644 --- a/typecheck.c +++ b/typecheck.c @@ -137,7 +137,8 @@ static env_t *load_module(env_t *env, ast_t *module_ast) if (!isalnum(*c) && *c != '_') *c = '_'; } - module_env->libname = (const char**)&libname_id; + module_env->libname = new(CORD); + *module_env->libname = (CORD)libname_id; for (int64_t i = 1; i <= files_f->num_lines; i++) { const char *line = get_line(files_f, i); line = heap_strn(line, strcspn(line, "\r\n")); @@ -150,7 +151,7 @@ static env_t *load_module(env_t *env, ast_t *module_ast) ast_t *ast = parse_file(tm_f, NULL); if (!ast) errx(1, "Could not compile!"); - env_t *module_file_env = fresh_scope(env); + env_t *module_file_env = fresh_scope(module_env); char *file_prefix = heap_str(file_base_name(line)); for (char *p = file_prefix; *p; p++) { if (!isalnum(*p) && *p != '_' && *p != '$') |
