mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-07 15:38:47 +00:00
likn_symbols _visitor done, but it is not tested yet
This commit is contained in:
parent
3c643d2759
commit
3d74b1383e
10 changed files with 236 additions and 427 deletions
|
|
@ -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_);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue