mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
fixes, colored errors
This commit is contained in:
parent
4b4756b657
commit
047ead6fa3
11 changed files with 166 additions and 195 deletions
|
|
@ -51,10 +51,12 @@ public:
|
|||
void ToGlobalNamespace();
|
||||
|
||||
utils::IdType AddFunctionDeclaration(const std::string& name,
|
||||
definition::FunctionDeclaration&& function_declaration_info);
|
||||
definition::FunctionDeclaration&& function_declaration_info,
|
||||
const interpreter::tokens::BaseNode& base_node);
|
||||
|
||||
utils::IdType AddFunctionDefinition(const std::string& name,
|
||||
definition::FunctionDefinition&& function_definition_info);
|
||||
definition::FunctionDefinition&& function_definition_info,
|
||||
const interpreter::tokens::BaseNode& base_node);
|
||||
|
||||
utils::IdType AddType(const std::string& type,
|
||||
definition::Type&& type_info,
|
||||
|
|
@ -124,6 +126,10 @@ public:
|
|||
std::optional<utils::IdType> FindNamespaceIn(
|
||||
utils::IdType current_namespace,
|
||||
const std::vector<std::string>& path);
|
||||
|
||||
std::unordered_map<std::string, utils::IdType>*
|
||||
ChooseNamespaces(std::optional<utils::IsConstModifier> modifier,
|
||||
utils::IdType namespace_id);
|
||||
private:
|
||||
GlobalInfo& global_info_;
|
||||
|
||||
|
|
@ -135,7 +141,6 @@ public:
|
|||
return NamespaceVisitor(*this);
|
||||
}
|
||||
|
||||
// remember about vector realloc
|
||||
definition::Function& GetFunctionInfo(utils::IdType id) {
|
||||
return functions_.at(id);
|
||||
}
|
||||
|
|
@ -148,27 +153,22 @@ public:
|
|||
return &std::get<T>(types_[id].type);
|
||||
}
|
||||
|
||||
// remember about vector realloc
|
||||
definition::Type& GetAnyTypeInfo(utils::IdType id) {
|
||||
return types_.at(id);
|
||||
}
|
||||
|
||||
// remember about vector realloc
|
||||
definition::Typeclass& GetTypeclassInfo(utils::IdType id) {
|
||||
return typeclasses_.at(id);
|
||||
}
|
||||
|
||||
// remember about vector realloc
|
||||
definition::Constructor& GetConstructorInfo(utils::IdType id) {
|
||||
return constructors_.at(id);
|
||||
}
|
||||
|
||||
// remember about vector realloc
|
||||
definition::Namespace& GetNamespaceInfo(utils::IdType id) {
|
||||
return namespaces_.at(id);
|
||||
}
|
||||
|
||||
// remember about vector realloc
|
||||
PartitionInfo& GetPartitionInfo(utils::IdType id) {
|
||||
return partitions_.at(id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue