diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-09-07 22:02:15 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-09-07 23:39:53 +0200 |
| commit | 72f5e82196d95008ed12c12de6bdccf24361e106 (patch) | |
| tree | 8319324de8e2a5182dc3c1ddca00a837c2489ad2 /boot/dependency.cc | |
| parent | 47521ad6d85f9bd6caee39696ce40dff82cfa50d (diff) | |
| download | elna-72f5e82196d95008ed12c12de6bdccf24361e106.tar.gz | |
Make module entry point more procedure like
Diffstat (limited to 'boot/dependency.cc')
| -rw-r--r-- | boot/dependency.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/boot/dependency.cc b/boot/dependency.cc index 9b52ce9..1eb5953 100644 --- a/boot/dependency.cc +++ b/boot/dependency.cc @@ -26,15 +26,23 @@ along with GCC; see the file COPYING3. If not see namespace elna::boot { - circular_import_error::circular_import_error(const source_position position, - const std::string& module_name) - : diagnostic(position), module_name(module_name) + import_error::import_error(const source_position position, + const std::string& module_name, const kind payload) + : diagnostic(position), module_name(module_name), m_payload(payload) { } - std::string circular_import_error::what() const + std::string import_error::what() const { - return "Circular import of module '" + this->module_name + "'"; + switch (this->m_payload) + { + case kind::circular: + return "Circular import of module '" + this->module_name + "'"; + case kind::program: + return "Module '" + this->module_name + "' is a program and cannot be imported"; + default: + __builtin_unreachable(); + } } read_result read_source(std::istream& entry_point, const target_info& target) |
