mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-07 23:48:43 +00:00
trying to fix basic types local types
This commit is contained in:
parent
25583d3edd
commit
24ff9a30d8
8 changed files with 132 additions and 54 deletions
|
|
@ -160,6 +160,16 @@ private:
|
|||
return maybe_internal_value_info.value();
|
||||
}
|
||||
|
||||
utils::IdType GraphIdByTypeId(utils::IdType type_id) {
|
||||
auto maybe_any_type = global_info_.GetTypeInfo<info::definition::AnyType>(type_id);
|
||||
if (!maybe_any_type.has_value()) {
|
||||
error_handling::HandleInternalError("Only AnyType implemented",
|
||||
"ExecuteVisitor.ExtractInternalValue",
|
||||
std::nullopt);
|
||||
}
|
||||
return maybe_any_type.value()->node->definition->type->graph_id_;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
bool HandleBuiltinFunctionCall(FunctionCallExpression* node);
|
||||
|
|
@ -170,7 +180,9 @@ private:
|
|||
info::GlobalInfo& global_info_;
|
||||
info::TypeclassGraph& typeclass_graph_;
|
||||
info::ContextManager<info::type::Type, info::type::TypeManager>& type_context_manager_;
|
||||
|
||||
info::ContextManager<info::value::Value, info::value::ValueManager>& context_manager_;
|
||||
// local types store types graph ids
|
||||
|
||||
utils::IdType current_value_;
|
||||
std::optional<LoopControlExpression> active_loop_control_expression_;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ public:
|
|||
std::unordered_map<std::string, FunctionInfo> functions;
|
||||
std::unordered_set<std::string> dependencies; // TODO: parameters
|
||||
interpreter::tokens::BaseNode* base_node; // for error handling
|
||||
std::optional<utils::IdType> type_id; // for defined types
|
||||
Modifier modifier;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue