From d1b2e9f598fb8e4c0bb46fda3bc2b8e03ff1db55 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 4 Sep 2024 13:48:26 -0400 Subject: Disallow 'use' statements that aren't top level --- tomo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tomo.c') diff --git a/tomo.c b/tomo.c index 01bdf5ae..6371a25f 100644 --- a/tomo.c +++ b/tomo.c @@ -324,9 +324,9 @@ void build_file_dependency_graph(const char *filename, table_t *to_compile, tabl switch (use->what) { case USE_LOCAL: { - const char *path = use->name; + const char *path = use->path; path = resolve_path(path, filename, ""); - if (!path) errx(1, "Couldn't resolve import: %s", use->name); + if (!path) errx(1, "Couldn't resolve import: %s", use->path); if (Table$str_get(*to_compile, path)) continue; build_file_dependency_graph(path, to_compile, to_link); @@ -334,16 +334,16 @@ void build_file_dependency_graph(const char *filename, table_t *to_compile, tabl break; } case USE_MODULE: { - const char *base_name = file_base_name(use->name); + const char *base_name = file_base_name(use->path); const char *lib_path = heap_strf("%s/lib%s.so", base_name, base_name); const char *libfile = resolve_path(lib_path, filename, getenv("TOMO_IMPORT_PATH")); if (!libfile) errx(1, "Couldn't resolve path: %s", lib_path); - const char *lib = heap_strf("-l%s", use->name); + const char *lib = heap_strf("-l%s", use->path); Table$str_set(to_link, lib, lib); break; } case USE_SHARED_OBJECT: { - const char *lib = heap_strf("-l:%s", use->name); + const char *lib = heap_strf("-l:%s", use->path); Table$str_set(to_link, lib, lib); break; } -- cgit v1.2.3