type_check_visitor first iteration, value, execution_visitor started

This commit is contained in:
ProgramSnail 2023-05-07 19:52:35 +03:00
parent 173d50672a
commit 890bd90eba
22 changed files with 481 additions and 452 deletions

View file

@ -107,10 +107,10 @@ public:
definition::Namespace* current_namespace,
const std::vector<std::string>& path);
private:
GlobalInfo& global_info_;
std::vector<definition::Namespace*> namespace_stack_;
std::vector<std::string> current_path_;
GlobalInfo& global_info_;
};
NamespaceVisitor CreateVisitor() {
@ -123,11 +123,11 @@ public:
}
template<typename T>
const std::optional<T>& GetTypeInfo(utils::IdType id) {
std::optional<T*> GetTypeInfo(utils::IdType id) {
if (!std::holds_alternative<T>(types_.at(id).type)) {
return std::nullopt;
}
return std::get<T>(types_[id].type);
return &std::get<T>(types_[id].type);
}
// remember about vector realloc
@ -146,6 +146,7 @@ public:
}
private:
std::vector<definition::Function> functions_;
std::vector<definition::Type> types_;
std::vector<definition::AbstractType> abstract_types_;