likn_symbols _visitor done, but it is not tested yet

This commit is contained in:
ProgramSnail 2023-04-17 18:56:58 +03:00
parent 3c643d2759
commit 3d74b1383e
10 changed files with 236 additions and 427 deletions

View file

@ -28,10 +28,12 @@ void GlobalInfo::NamespaceVisitor::AddEnterNamespace(const std::string& name,
}
namespace_info->type_name = name;
current_path_.push_back(name);
}
void GlobalInfo::NamespaceVisitor::EnterNamespace(const std::string& name) { // TODO: enter sibling namespace, etc.
namespace_stack_.push_back(&namespace_stack_.back()->namespaces[name]);
current_path_.push_back(name);
}
void GlobalInfo::NamespaceVisitor::ExitNamespace() {
@ -41,10 +43,13 @@ void GlobalInfo::NamespaceVisitor::ExitNamespace() {
}
namespace_stack_.pop_back();
current_path_.pop_back();
}
void GlobalInfo::NamespaceVisitor::ToGlobalNamespace() {
namespace_stack_.clear();
current_path_.clear();
namespace_stack_.push_back(&global_info_.global_namespace_);
}