diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-08-05 01:03:55 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-08-05 21:27:36 +0200 |
| commit | b2dee14873402ee3d13d59ae5579593796ea862f (patch) | |
| tree | 1f245eac1a23a73f45124498fc8274874e35750e /boot/symbol.cc | |
| parent | 1c2fb173ea3b674207badc721556ad72962b266e (diff) | |
| download | elna-b2dee14873402ee3d13d59ae5579593796ea862f.tar.gz | |
Check that constants are initialized
Diffstat (limited to 'boot/symbol.cc')
| -rw-r--r-- | boot/symbol.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/boot/symbol.cc b/boot/symbol.cc index 6172621..1cc652c 100644 --- a/boot/symbol.cc +++ b/boot/symbol.cc @@ -165,19 +165,16 @@ namespace elna::boot } else if constexpr (std::is_same_v<T, std::shared_ptr<procedure_type>>) { - std::string result = "proc("; - for (std::size_t i = 0; i < payload->parameters.size(); ++i) + std::string result = "proc(" + join(payload->parameters) + ")"; + + if (payload->return_type.no_return) { - if (i > 0) { result += ", "; -} - result += payload->parameters[i].to_string(); - } - result += ")"; - if (payload->return_type.no_return) { result += ": !"; - } else if (!payload->return_type.proper_type.empty()) { + } + else if (!payload->return_type.proper_type.empty()) + { result += ": " + payload->return_type.proper_type.to_string(); -} + } return result; } else if constexpr (std::is_same_v<T, std::shared_ptr<enumeration_type>>) @@ -368,6 +365,12 @@ namespace elna::boot this->imports.push_front(bag.exported_symbols()); } + bool symbol_bag::is_global() const + { + return this->symbols->scope() != nullptr + && this->symbols->scope()->scope() == nullptr; + } + std::shared_ptr<symbol_table> symbol_bag::exported_symbols() const { if (!m_exported) |
