WIP try simplification

This commit is contained in:
Luke Boswell 2024-04-08 22:18:45 +10:00
parent 85b76a14b4
commit 8b9e08bd76
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
13 changed files with 734 additions and 551 deletions

View file

@ -340,6 +340,7 @@ pub enum Expr<'a> {
// Problems
MalformedIdent(&'a str, crate::ident::BadIdent),
MalformedClosure,
MalformedSuffixed(&'a Loc<Expr<'a>>),
// Both operators were non-associative, e.g. (True == False == False).
// We should tell the author to disambiguate by grouping them with parens.
PrecedenceConflict(&'a PrecedenceConflict<'a>),
@ -748,7 +749,7 @@ impl<'a> Defs<'a> {
}
// For desugaring Suffixed Defs we need to split the defs around the Suffixed value
pub fn split_defs_around(&self, target: usize) -> SplitDefsAround {
pub fn split_defs_around(self, target: usize) -> SplitDefsAround<'a> {
let mut before = self.clone();
let mut after = self.clone();
@ -1807,6 +1808,7 @@ impl<'a> Malformed for Expr<'a> {
MalformedIdent(_, _) |
MalformedClosure |
MalformedSuffixed(..) |
PrecedenceConflict(_) |
MultipleRecordBuilders(_) |
UnappliedRecordBuilder(_) => true,