mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 14:18:47 +00:00
Fix cyclic importation error printing
This commit is contained in:
+11
-7
@@ -2838,14 +2838,18 @@ void check_import_entities(Checker *c) {
|
|||||||
return token;
|
return token;
|
||||||
};
|
};
|
||||||
|
|
||||||
Scope *s = path[0];
|
|
||||||
Token token = mt(s);
|
if (path.count > 0) {
|
||||||
error(token, "Cyclic importation of `%.*s`", LIT(token.string));
|
Scope *s = path[path.count-1];
|
||||||
for (isize i = path.count-1; i >= 0; i--) {
|
Token token = mt(s);
|
||||||
gb_printf_err("\t`%.*s` refers to", LIT(token.string));
|
error(token, "Cyclic importation of `%.*s`", LIT(token.string));
|
||||||
s = path[i];
|
for (isize i = 0; i < path.count; i++) {
|
||||||
|
gb_printf_err("\t`%.*s` refers to\n", LIT(token.string));
|
||||||
|
s = path[i];
|
||||||
|
token = mt(s);
|
||||||
|
}
|
||||||
|
gb_printf_err("\t`%.*s`\n", LIT(token.string));
|
||||||
}
|
}
|
||||||
gb_printf_err("\t`%.*s`", LIT(token.string));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user