aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-10-10 01:09:17 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-10-10 01:09:17 -0400
commit67702b2d77d8474c2a7fe7f1816f4eb9a0a98af1 (patch)
tree0294659e9ef662577c175af0c5989ab9a8f254c5 /typecheck.c
parenta2490f4a500fca4b84e5652d31fc621f9f20742b (diff)
Fix issue with non-ID chars in filenames
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/typecheck.c b/typecheck.c
index a5d0d2e8..aefd94cf 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -166,11 +166,7 @@ static env_t *load_module(env_t *env, ast_t *module_ast)
ast_t *ast = parse_file(filename, NULL);
if (!ast) errx(1, "Could not compile file %s", filename);
env_t *module_file_env = fresh_scope(module_env);
- char *file_prefix = GC_strdup(file_base_name(filename));
- for (char *p = file_prefix; *p; p++) {
- if (!isalnum(*p) && *p != '_' && *p != '$')
- *p = '_';
- }
+ char *file_prefix = file_base_id(filename);
module_file_env->namespace = new(namespace_t, .name=file_prefix);
env_t *subenv = load_module_env(module_file_env, ast);
for (int64_t j = 0; j < subenv->locals->entries.length; j++) {