conlang: Unify binding operations!

This breaks out the pattern matching/unification algorithm from cl-interpret/interpret.rs to cl-interpret/pattern.rs

TODO: pattern destructuring in const, static :^)
This commit is contained in:
2025-02-22 05:16:37 -06:00
parent 7a8da33de9
commit e3d94d8949
14 changed files with 202 additions and 171 deletions

View File

@@ -89,9 +89,9 @@ pub trait Visit<'a>: Sized {
}
}
fn visit_param(&mut self, p: &'a Param) {
let Param { mutability, name } = p;
let Param { mutability, bind } = p;
self.visit_mutability(mutability);
self.visit_sym(name);
self.visit_pattern(bind);
}
fn visit_struct(&mut self, s: &'a Struct) {
let Struct { name, kind } = s;