Make unit assignment optional for suffixed defs

This commit is contained in:
Luke Boswell 2024-03-23 14:40:28 +11:00
parent 237bd942ed
commit 42fdcb7ff1
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
15 changed files with 208 additions and 7 deletions

View file

@ -872,6 +872,10 @@ impl<'a> PatternAs<'a> {
pub enum Pattern<'a> {
// Identifier
Identifier(&'a str),
QualifiedIdentifier {
module_name: &'a str,
ident: &'a str,
},
Tag(&'a str),
@ -923,10 +927,9 @@ pub enum Pattern<'a> {
// Malformed
Malformed(&'a str),
MalformedIdent(&'a str, crate::ident::BadIdent),
QualifiedIdentifier {
module_name: &'a str,
ident: &'a str,
},
// Statement e.g. `Stdout.line! "Hello"`
Stmt(&'a str),
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
@ -1126,6 +1129,8 @@ impl<'a> Pattern<'a> {
false
}
}
Stmt(_) => todo!(),
}
}
}
@ -1773,6 +1778,8 @@ impl<'a> Malformed for Pattern<'a> {
Malformed(_) |
MalformedIdent(_, _) |
QualifiedIdentifier { .. } => true,
Stmt(_) => todo!(),
}
}
}