Add tuple and map literals

This commit introduces support for tuple and map literals in the AST.
Tuples are now represented by `UntypedKind::Tuple` and maps by
`UntypedKind::Map`.
The `Binder` has been updated to correctly handle these new node types
and infer their types.
The `VM` now also supports evaluating tuple and map literals.
This commit is contained in:
Michael Schimmel
2026-02-17 13:07:17 +01:00
parent d55422272b
commit 9afde5a301
5 changed files with 92 additions and 177 deletions
+8
View File
@@ -51,6 +51,14 @@ pub enum BoundKind {
exprs: Vec<Node<BoundKind, StaticType>>,
},
// NEW
Tuple {
elements: Vec<Node<BoundKind, StaticType>>,
},
Map {
entries: Vec<(Node<BoundKind, StaticType>, Node<BoundKind, StaticType>)>,
},
// Extension points (need to be adapted for bound nodes if they use variables)
// For now, we assume extensions are self-contained or handled dynamically.
}