improved malformed patterns

This commit is contained in:
Folkert 2021-03-01 16:12:37 +01:00
parent 2ae993d695
commit a87dfac7da
10 changed files with 316 additions and 126 deletions

View file

@ -39,6 +39,7 @@ impl<'a> Formattable<'a> for Pattern<'a> {
| Pattern::StrLiteral(_)
| Pattern::Underscore(_)
| Pattern::Malformed(_)
| Pattern::MalformedIdent(_, _)
| Pattern::QualifiedIdentifier { .. } => false,
}
}
@ -157,7 +158,7 @@ impl<'a> Formattable<'a> for Pattern<'a> {
}
// Malformed
Malformed(string) => buf.push_str(string),
Malformed(string) | MalformedIdent(string, _) => buf.push_str(string),
QualifiedIdentifier { module_name, ident } => {
if !module_name.is_empty() {
buf.push_str(module_name);