mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
type_check_visitor first iteration, value, execution_visitor started
This commit is contained in:
parent
173d50672a
commit
890bd90eba
22 changed files with 481 additions and 452 deletions
|
|
@ -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_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue