doughlang: Expressions in patterns

ast:
- Document operators
- Parameterize Pat with Annotation
- Consolidate Path and Lit into "Value" (Expr)
- Consolidate NamedRecord/Namedtuple into PatOp::TypePrefixed
- Allow Pat<Pat,*> patterns
- Additional helper functions on Expr and Pat

lexer:
- Support inner-doc comment syntax `//!`
  - Cleans up `///` or `//!` prefix

parser:
- Make Parse::Prec `Default`
- Allow expression elision after `..`/`..=`
- Fix Parser::consume not updating elide_do state
- Add token splitting, to make `&&Expr` and `&&Pat` easier
- error: Embed Pat precedence in ParseError
This commit is contained in:
2026-01-05 15:17:22 -05:00
parent d6104b6a0b
commit e4c008bd4b
16 changed files with 700 additions and 322 deletions

View File

@@ -130,7 +130,7 @@ impl<'a> Visit<'a> for CountNodes {
item.children(self)
}
fn visit_pat(&mut self, item: &'a Pat) -> Result<(), Self::Error> {
fn visit_pat<A: Annotation>(&mut self, item: &'a Pat<A>) -> Result<(), Self::Error> {
self.patterns += 1;
item.children(self)
}