From b2dee14873402ee3d13d59ae5579593796ea862f Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Wed, 5 Aug 2026 01:03:55 +0200 Subject: Check that constants are initialized --- boot/symbol.cc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'boot/symbol.cc') 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>) { - 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>) @@ -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_bag::exported_symbols() const { if (!m_exported) -- cgit v1.2.3