summaryrefslogtreecommitdiff
path: root/compiler.c
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-03-26 04:47:38 -0400
committerKyle Gunger <kgunger12@gmail.com>2024-03-26 04:47:38 -0400
commite6fa86985af283622d28613ab46b87fc7c5a4685 (patch)
treed4c7a683fdfa37d49fa64df3cfdb0a399fda4b36 /compiler.c
parent7c1c14f592f854ed58385005a27230617d8ba6b2 (diff)
fix submod search
Diffstat (limited to 'compiler.c')
-rw-r--r--compiler.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler.c b/compiler.c
index 24359d9..da2bd70 100644
--- a/compiler.c
+++ b/compiler.c
@@ -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;