From 4d812e9b9bcf2530ab5a3275be85365ee277bea8 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 16 Jan 2025 10:44:27 +0200 Subject: use maps for scope --- src/compiler.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/compiler.c') diff --git a/src/compiler.c b/src/compiler.c index 2041efd..7ce6167 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -132,8 +132,8 @@ static int process(struct scope **parent, int public, const char *file) static int copy_scope(struct scope *to, struct scope *from) { /** @todo handle duplicates */ - foreach_visible(n, from->symbols) { - struct ast *def = n->node; + foreach(visible, n, &from->symbols) { + struct ast *def = n->data; if (!ast_flags(def, AST_FLAG_PUBLIC)) continue; @@ -206,6 +206,7 @@ int process_file(struct scope **scope, int public, const char *file) if (copy_scope(*scope, *exists)) goto out; + free(real); } else { if (process(scope, public, base)) goto out; -- cgit v1.3