diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-09-09 20:09:53 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-09-09 20:09:53 -0400 |
| commit | b4f2d03db2cd20688d6bb537904998e997bc48aa (patch) | |
| tree | 380ce33e0ce1b7fa3ce7c88b5ca59a84b58f4821 /src/typecheck.c | |
| parent | d8a48f64111f542f3afeb5d6e47ff092f9278d9f (diff) | |
| parent | d64dcab138a34d5f5105e08f0a840f7cb5a1d159 (diff) | |
Merge branch 'main' into optional-list-indexingoptional-list-indexing
Diffstat (limited to 'src/typecheck.c')
| -rw-r--r-- | src/typecheck.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/typecheck.c b/src/typecheck.c index d7e87e65..e9968f09 100644 --- a/src/typecheck.c +++ b/src/typecheck.c @@ -165,15 +165,15 @@ PUREFUNC type_t *get_math_type(env_t *env, ast_t *ast, type_t *lhs_t, type_t *rh return NULL; } -static env_t *load_module(env_t *env, ast_t *module_ast) { - DeclareMatch(use, module_ast, Use); +static env_t *load_module(env_t *env, ast_t *use_ast) { + DeclareMatch(use, use_ast, Use); switch (use->what) { case USE_LOCAL: { - Path_t source_path = Path$from_str(module_ast->file->filename); + Path_t source_path = Path$from_str(use_ast->file->filename); Path_t source_dir = Path$parent(source_path); Path_t used_path = Path$resolved(Path$from_str(use->path), source_dir); - if (!Path$exists(used_path)) code_err(module_ast, "No such file exists: ", quoted(use->path)); + if (!Path$exists(used_path)) code_err(use_ast, "No such file exists: ", quoted(use->path)); env_t *module_env = Table$str_get(*env->imports, String(used_path)); if (module_env) return module_env; @@ -183,12 +183,12 @@ static env_t *load_module(env_t *env, ast_t *module_ast) { return load_module_env(env, ast); } case USE_MODULE: { - module_info_t mod = get_module_info(module_ast); + module_info_t mod = get_used_module_info(use_ast); glob_t tm_files; const char *folder = mod.version ? String(mod.name, "_", mod.version) : mod.name; if (glob(String(TOMO_PATH, "/lib/tomo_" TOMO_VERSION "/", folder, "/[!._0-9]*.tm"), GLOB_TILDE, NULL, &tm_files) != 0) { - if (!try_install_module(mod, true)) code_err(module_ast, "Couldn't find or install library: ", folder); + if (!try_install_module(mod, true)) code_err(use_ast, "Couldn't find or install library: ", folder); } env_t *module_env = fresh_scope(env); |
