constructors on heap, consuming match, move modifier in reference expression, .bring. keyword to return from block, some fixes

This commit is contained in:
ProgramSnail 2023-05-20 20:18:49 +03:00
parent 2556efcaba
commit 8a84cfff70
12 changed files with 128 additions and 34 deletions

View file

@ -174,7 +174,8 @@ private:
utils::IdType current_value_;
std::optional<LoopControlExpression> active_loop_control_expression_;
std::optional<utils::IdType> returned_value_; // TODO: work outside block ??
std::optional<utils::IdType> returned_value_;
std::optional<utils::IdType> brought_value_;
std::optional<utils::IsConstModifier> is_const_definition_;
bool case_matched_;
};

View file

@ -420,6 +420,8 @@ struct Match {
Expression value;
std::vector<MatchCase> matches;
bool is_consuming_value = false;
};
struct Condition {
@ -545,6 +547,8 @@ struct ReturnExpression {
BaseNode base;
Expression expression;
bool is_from_definition = false; // from definition or from current block
};
struct TypeConstructorParameter {
@ -560,6 +564,8 @@ struct TypeConstructor {
std::unique_ptr<TypeExpression> constructor;
std::vector<TypeConstructorParameter> parameters;
bool is_allocated_on_heap = false;
};
struct LambdaFunction {

View file

@ -178,6 +178,7 @@ private:
std::unordered_set<utils::IdType> type_namespaces_;
utils::IdType current_type_;
std::optional<utils::IdType> returned_type_;
std::optional<utils::IdType> brought_type_;
std::optional<utils::IsConstModifier> is_const_definition_;
bool is_in_statement_ = false;