parser: Refactor coagulated binops as postfix operators

This allows them to intermingle more nicely with `Try`
This commit is contained in:
2025-09-15 10:28:08 -04:00
committed by Val
parent baf94a9dab
commit b6949147c4
6 changed files with 338 additions and 208 deletions

View File

@@ -191,6 +191,8 @@ impl<A: Annotation> Match<A> for Pat {
(Pat::Tuple(_), _) => false,
(Pat::Slice(pat), Pat::Slice(expr)) => Match::recurse(sub, pat, expr),
(Pat::Slice(_), _) => false,
(Pat::Alt(pat), Pat::Alt(expr)) => Match::recurse(sub, pat, expr),
(Pat::Alt(_), _) => false,
}
}
@@ -205,6 +207,7 @@ impl<A: Annotation> Match<A> for Pat {
Pat::Rest(pat) => pat.apply(sub),
Pat::Tuple(pats) => pats.apply(sub),
Pat::Slice(pats) => pats.apply(sub),
Pat::Alt(pats) => pats.apply(sub),
}
}
}