mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-05 22:48:42 +00:00
constructors on heap, consuming match, move modifier in reference expression, .bring. keyword to return from block, some fixes
This commit is contained in:
parent
2556efcaba
commit
8a84cfff70
12 changed files with 128 additions and 34 deletions
|
|
@ -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_;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue