mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-07 07:28:44 +00:00
fixes, build_visitor TupleType and VariantType fix
This commit is contained in:
parent
692f7ea3ec
commit
b723fd6a65
12 changed files with 321 additions and 241 deletions
|
|
@ -63,6 +63,7 @@ void ExecuteVisitor::Visit(PartitionStatement* node) {
|
|||
void ExecuteVisitor::Visit(TypeConstructorPatternParameter* node) {} // handled in TypeConstructorPattern
|
||||
|
||||
// TODO
|
||||
// TODO: tuples
|
||||
// TODO: non-variant constructor patterns
|
||||
void ExecuteVisitor::Visit(TypeConstructorPattern* node) {
|
||||
if (!node->constructor->constructor_id_.has_value()) { // checked in typeckeck visitor ??
|
||||
|
|
@ -475,7 +476,7 @@ void ExecuteVisitor::Visit(ReturnExpression* node) {
|
|||
|
||||
void ExecuteVisitor::Visit(TypeConstructorParameter* node) {} // handled in TypeConstructor
|
||||
|
||||
|
||||
// TODO: variants, etc.
|
||||
void ExecuteVisitor::Visit(TypeConstructor* node) {
|
||||
// TODO: support for non-tuples
|
||||
std::vector<std::pair<std::optional<std::string>, utils::IdType>> fields;
|
||||
|
|
@ -493,6 +494,10 @@ void ExecuteVisitor::Visit(TypeConstructor* node) {
|
|||
current_value_ = context_manager_.AddValue<info::value::TupleValue>(
|
||||
info::value::TupleValue(std::move(fields), context_manager_.GetValueManager()),
|
||||
utils::ValueType::Tmp);
|
||||
|
||||
// if (constructor_info.order.has_value()) {
|
||||
// // TODO: construct variant value
|
||||
// }
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue