From 2e12c7f63c8f667e3f2834604898ac155a1b421a Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Thu, 15 Jan 2026 14:50:44 +0000 Subject: Zen facts now only trigger in clean builds (no errors/warnings). --- src/parser/parser_stmt.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/parser') diff --git a/src/parser/parser_stmt.c b/src/parser/parser_stmt.c index 24dfa10..6f93dbf 100644 --- a/src/parser/parser_stmt.c +++ b/src/parser/parser_stmt.c @@ -3725,6 +3725,14 @@ ASTNode *parse_import(ParserContext *ctx, Lexer *l) } } + // Canonicalize path to avoid duplicates (for example: "./std/io.zc" vs "std/io.zc") + char *real_fn = realpath(fn, NULL); + if (real_fn) + { + free(fn); + fn = real_fn; + } + // Check if file already imported if (is_file_imported(ctx, fn)) { -- cgit v1.2.3