mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-07 15:38:47 +00:00
partition syntax changed, interface modifier added
This commit is contained in:
parent
3fca384446
commit
b1aff1935d
22 changed files with 299 additions and 266 deletions
|
|
@ -223,6 +223,25 @@ utils::IdType GlobalInfo::NamespaceVisitor::AddConstructor(const std::string& co
|
|||
return 0;
|
||||
}
|
||||
|
||||
utils::IdType GlobalInfo::NamespaceVisitor::AddPartition(const std::vector<std::string>& path,
|
||||
const std::string& name,
|
||||
interpreter::tokens::PartitionStatement* node) {
|
||||
PartitionInfo partition;
|
||||
|
||||
partition.path.reserve(current_path_.size() + path.size());
|
||||
partition.path = current_path_;
|
||||
|
||||
for (auto& path_namespace : path) {
|
||||
partition.path.push_back(path_namespace);
|
||||
}
|
||||
|
||||
partition.name = name;
|
||||
partition.node = node;
|
||||
|
||||
global_info_.partitions_.push_back(partition);
|
||||
return global_info_.partitions_.size() - 1;
|
||||
}
|
||||
|
||||
std::optional<definition::Namespace*> GlobalInfo::NamespaceVisitor::FindNamespace(const std::optional<std::vector<std::string>>& path) {
|
||||
return FindSomething<definition::Namespace*>(path,
|
||||
[] (definition::Namespace* current_namespace) -> std::optional<definition::Namespace*> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue