aboutsummaryrefslogtreecommitdiff
path: root/boot/symbol.cc
diff options
context:
space:
mode:
Diffstat (limited to 'boot/symbol.cc')
-rw-r--r--boot/symbol.cc23
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)