aboutsummaryrefslogtreecommitdiff
path: root/src/lower.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-03-22 16:36:18 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2025-03-22 16:36:18 +0200
commit350f6c40fa18c35bde9489225175c82de44ba709 (patch)
treed010427fb92a59a901c9a90f7a2b6db64484f0c5 /src/lower.c
parent199d1342d76b5cae6503fa0a97322d2658d43b5f (diff)
downloadfwd-350f6c40fa18c35bde9489225175c82de44ba709.tar.gz
fwd-350f6c40fa18c35bde9489225175c82de44ba709.zip
use maps in scope
Diffstat (limited to 'src/lower.c')
-rw-r--r--src/lower.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lower.c b/src/lower.c
index 21844ae..89d9aca 100644
--- a/src/lower.c
+++ b/src/lower.c
@@ -476,8 +476,8 @@ static int lower_block_vars(struct state *state, struct ast *block)
struct scope *scope = block->scope;
bool populated = false;
- foreach_visible(n, scope->symbols) {
- struct ast *def = n->node;
+ foreach(visible, n, &scope->symbols) {
+ struct ast *def = n->data;
if (def->k != AST_VAR_DEF)
continue;
@@ -626,15 +626,15 @@ int lower(struct scope *root)
{
printf("#include <fwdlib.hpp>\n");
- foreach_visible(visible, root->symbols) {
- struct ast *proc = visible->node;
+ foreach(visible, visible, &root->symbols) {
+ struct ast *proc = visible->data;
assert(proc->k == AST_PROC_DEF);
if (lower_proto(proc))
return -1;
}
- foreach_visible(visible, root->symbols) {
- struct ast *proc = visible->node;
+ foreach(visible, visible, &root->symbols) {
+ struct ast *proc = visible->data;
if (lower_proc(proc))
return -1;
}