From 72f5e82196d95008ed12c12de6bdccf24361e106 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 7 Sep 2026 22:02:15 +0200 Subject: Make module entry point more procedure like --- boot/name_analysis.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'boot/name_analysis.cc') diff --git a/boot/name_analysis.cc b/boot/name_analysis.cc index 77335d1..37c7ced 100644 --- a/boot/name_analysis.cc +++ b/boot/name_analysis.cc @@ -1131,6 +1131,7 @@ namespace elna::boot { add_error(unit->position(), declaration_format_error::kind::module_entry); + return; } else if (unit->parameters.size() == 1) { @@ -1150,18 +1151,12 @@ namespace elna::boot } this->bag.leave(); - info->position.emplace(unit->position()); + info->position = unit->entry_position; info->file = this->module_file; - if (!this->bag.enter("", info)) - { - auto original = this->bag.lookup(""); - symbol_declaration_error::redefinition original_definition{ - .original = original->position, - .file = this->redefinition_file(original) - }; - add_error(unit->position(), "program", original_definition); - } + // A unit has at most one entry point and an imported program is + // rejected before its symbols are merged, so this cannot collide. + this->bag.enter("", info); } } -- cgit v1.2.3