mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Make unit assignment optional for suffixed defs
This commit is contained in:
parent
237bd942ed
commit
42fdcb7ff1
15 changed files with 208 additions and 7 deletions
|
@ -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!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue