New Lambda Syntax with |...|

This adds parser support for the new lambda syntax.  It does not remove
the existing syntax, nor will the new syntax be retained in formatting.
That will be done in a separate PR to keep the two respective PRs
relatively small and easy to review.
This commit is contained in:
Anthony Bullard 2025-01-15 05:50:34 -06:00
parent 4e66910ef8
commit 8e1e1520e3
No known key found for this signature in database
6 changed files with 172 additions and 50 deletions

View file

@ -747,6 +747,7 @@ impl<'a> EInParens<'a> {
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum EClosure<'a> {
Bar(Position),
Space(BadInputError, Position),
Start(Position),
Arrow(Position),
@ -768,7 +769,8 @@ impl<'a> EClosure<'a> {
EClosure::Body(expr, _) => expr.get_region(),
// Cases with Position values
EClosure::Space(_, p)
EClosure::Bar(p)
| EClosure::Space(_, p)
| EClosure::Start(p)
| EClosure::Arrow(p)
| EClosure::Comma(p)