remove parse::ast::Def

This commit is contained in:
Folkert 2022-07-10 01:10:37 +02:00
parent 7b308d9efe
commit 3dee90ced8
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
8 changed files with 38 additions and 243 deletions

View file

@ -3,7 +3,7 @@ use bumpalo::Bump;
use roc_module::called_via::{BinOp, UnaryOp};
use roc_parse::{
ast::{
AbilityMember, AssignedField, Collection, CommentOrNewline, Def, Defs, Derived, Expr, Has,
AbilityMember, AssignedField, Collection, CommentOrNewline, Defs, Derived, Expr, Has,
HasClause, Module, Pattern, Spaced, StrLiteral, StrSegment, Tag, TypeAnnotation, TypeDef,
TypeHeader, ValueDef, WhenBranch,
},
@ -545,17 +545,6 @@ impl<'a> RemoveSpaces<'a> for ValueDef<'a> {
}
}
impl<'a> RemoveSpaces<'a> for Def<'a> {
fn remove_spaces(&self, arena: &'a Bump) -> Self {
match *self {
Def::Type(def) => Def::Type(def.remove_spaces(arena)),
Def::Value(def) => Def::Value(def.remove_spaces(arena)),
Def::NotYetImplemented(a) => Def::NotYetImplemented(a),
Def::SpaceBefore(a, _) | Def::SpaceAfter(a, _) => a.remove_spaces(arena),
}
}
}
impl<'a> RemoveSpaces<'a> for Has<'a> {
fn remove_spaces(&self, _arena: &'a Bump) -> Self {
Has::Has