doughlang: let else, fn rety
ast: - `let Pat (= Expr (else Expr)?)?`, - `fn (args) -> Ty`, coagulating `do`, `if/while` formatting fixes parser: - int cleanup, - fn rety parsing, - experimental `for` desugar, - experimental semicolon elision (TODO: it sucks), - let-else parsing - `do` coagulation impl (still not 100% there) TODO: - Fix `do` coagulation - codify `do` elision rules - `for` needs lib support - this is fine because we have no codegen yet - Ty matching in macro_matcher - Or rip out macro_matcher? Who knows what the future holds.
This commit is contained in:
@@ -93,14 +93,17 @@ impl<A: Annotation> Match<A> for Const<A> {
|
||||
|
||||
impl<A: Annotation> Match<A> for Fn<A> {
|
||||
fn recurse(sub: &mut Subst<A>, pat: &Self, expr: &Self) -> bool {
|
||||
let (Self(pat_id, pat_arg, pat_body), Self(expr_id, expr_arg, expr_body)) = (pat, expr);
|
||||
let (
|
||||
Self(pat_id, pat_arg, _pat_rety, pat_body),
|
||||
Self(expr_id, expr_arg, _expr_rety, expr_body),
|
||||
) = (pat, expr);
|
||||
pat_id == expr_id
|
||||
&& Match::recurse(sub, pat_arg, expr_arg)
|
||||
&& Match::recurse(sub, pat_body, expr_body)
|
||||
}
|
||||
|
||||
fn apply(&mut self, sub: &Subst<A>) {
|
||||
let Self(_, pat, body) = self;
|
||||
let Self(_, pat, _rety, body) = self;
|
||||
pat.apply(sub);
|
||||
body.apply(sub);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user