Skip to content

Commit

Permalink
also
Browse files Browse the repository at this point in the history
  • Loading branch information
littlewhitecloud authored Oct 22, 2023
1 parent f4041e0 commit 080fb23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions self_hosted/main.jou
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ class Compiler:
if strcmp(self->files[isrc].ast.path, imp->resolved_path) == 0:
src = &self->files[isrc]
break
if (src->ast.path == dest->ast.path) {
fail(imp->location, "the file itself cannot be imported")
}

assert src != NULL

for exp = src->pending_exports; exp->name[0] != '\0'; exp++:
Expand Down

0 comments on commit 080fb23

Please sign in to comment.