diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-03-26 04:47:38 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-03-26 04:47:38 -0400 |
commit | e6fa86985af283622d28613ab46b87fc7c5a4685 (patch) | |
tree | d4c7a683fdfa37d49fa64df3cfdb0a399fda4b36 | |
parent | 7c1c14f592f854ed58385005a27230617d8ba6b2 (diff) |
fix submod search
-rw-r--r-- | compiler.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -2279,7 +2279,11 @@ void *mod_find_rec(Module *mod, Artifact *art, size_t sub, int find_type) { void *out = NULL; for (size_t i = 0; i < mod->submods.count; i++) { Module *m = vect_get(&(mod->submods), i); - if (strcmp(m->name, *to_check) == 0 || strcmp(m->name, e_check.data) == 0 || strcmp(m->name, t_check.data)) { + if ( + strcmp(m->name, *to_check) == 0 || + strcmp(m->name, e_check.data) == 0 || + strcmp(m->name, t_check.data) == 0 + ) { out = mod_find_rec(m, art, sub + 1, find_type); break; } @@ -4704,6 +4708,7 @@ Variable _eval_dot(Scope *s, CompData *data, Vector *tokens, size_t start, size_ if (v.name == NULL) { Function *f = mod_find_func(s->current, &name); if (f == NULL) { + t = vect_get(tokens, start - 1); printf("ERROR: Could not find function \"%s\" (%d:%d)\n\n", t->data, t->line, t->col); art_end(&name); return v; @@ -4712,6 +4717,7 @@ Variable _eval_dot(Scope *s, CompData *data, Vector *tokens, size_t start, size_ } else { Function *m = mod_find_func(v.type->module, &name); if (m == NULL) { + t = vect_get(tokens, start - 1); printf("ERROR: Could not find function \"%s\" (%d:%d)\n\n", t->data, t->line, t->col); art_end(&name); return v; |