refactor PatternAs

This commit is contained in:
Folkert 2022-12-30 18:22:10 +01:00
parent e9196f3c0b
commit aff70bb6bd
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
6 changed files with 94 additions and 52 deletions

View file

@ -766,11 +766,9 @@ impl<'a> RemoveSpaces<'a> for Pattern<'a> {
Pattern::OptionalField(a, b) => {
Pattern::OptionalField(a, arena.alloc(b.remove_spaces(arena)))
}
Pattern::As(pattern, spaces, identifier) => Pattern::As(
arena.alloc(pattern.remove_spaces(arena)),
spaces,
identifier,
),
Pattern::As(pattern, pattern_as) => {
Pattern::As(arena.alloc(pattern.remove_spaces(arena)), pattern_as)
}
Pattern::NumLiteral(a) => Pattern::NumLiteral(a),
Pattern::NonBase10Literal {
string,
@ -794,7 +792,7 @@ impl<'a> RemoveSpaces<'a> for Pattern<'a> {
Pattern::SingleQuote(a) => Pattern::SingleQuote(a),
Pattern::List(pats) => Pattern::List(pats.remove_spaces(arena)),
Pattern::Tuple(pats) => Pattern::Tuple(pats.remove_spaces(arena)),
Pattern::ListRest => Pattern::ListRest,
Pattern::ListRest(opt_pattern_as) => Pattern::ListRest(opt_pattern_as),
}
}
}