internal: replace AstTransformer with mutable syntax trees

This commit is contained in:
Aleksey Kladov 2021-05-18 14:42:41 +03:00
parent 3cfe2d0a5d
commit 47d7434dde
6 changed files with 123 additions and 208 deletions

View file

@ -239,6 +239,16 @@ impl ast::TypeBoundList {
}
}
impl ast::PathSegment {
pub fn get_or_create_generic_arg_list(&self) -> ast::GenericArgList {
if self.generic_arg_list().is_none() {
let arg_list = make::generic_arg_list().clone_for_update();
ted::append_child(self.syntax(), arg_list.syntax())
}
self.generic_arg_list().unwrap()
}
}
impl ast::UseTree {
pub fn remove(&self) {
for &dir in [Direction::Next, Direction::Prev].iter() {