conlang: PATTERN MATCHING AND DESTRUCTURED BINDINGS WOOOOO

- Integrate the Match and Pattern nodes into the AST
  - TODO: `let x: T` is ambiguous with `let x: {}`. Currently the latter takes precedence in the parser.

- Implement pattern matching through unification in the interpreter.
  - It's not fast, but it works!

- Refactor destructuring assignments to use the new pattern functionality
This commit is contained in:
2025-01-29 04:15:33 -06:00
parent 6e94b702c9
commit 6ee9bbd72e
14 changed files with 285 additions and 119 deletions

View File

@@ -380,6 +380,7 @@ pub mod yamlify {
match self {
ExprKind::Quote(k) => k.yaml(y),
ExprKind::Let(k) => k.yaml(y),
ExprKind::Match(k) => k.yaml(y),
ExprKind::Assign(k) => k.yaml(y),
ExprKind::Modify(k) => k.yaml(y),
ExprKind::Binary(k) => k.yaml(y),