mod token_ext;
mod node_ext;
mod expr_ext;
+mod operators;
pub mod edit;
pub mod edit_in_place;
pub mod make;
};
pub use self::{
- expr_ext::{ArrayExprKind, BinOp, Effect, ElseBranch, LiteralKind, PrefixOp, RangeOp},
+ expr_ext::{ArrayExprKind, BlockModifier, CallableExpr, ElseBranch, LiteralKind},
generated::{nodes::*, tokens::*},
node_ext::{
AttrKind, FieldKind, Macro, NameLike, NameOrNameRef, PathSegmentKind, SelfParamKind,
SlicePatComponents, StructKind, TypeBoundKind, VisibilityKind,
},
- token_ext::*,
- traits::*,
+ operators::{ArithOp, BinaryOp, CmpOp, LogicOp, Ordering, RangeOp, UnaryOp},
+ token_ext::{CommentKind, CommentPlacement, CommentShape, IsString, QuoteOffsets, Radix},
+ traits::{
+ DocCommentIter, HasArgList, HasAttrs, HasDocComments, HasGenericParams, HasLoopBody,
+ HasModuleItem, HasName, HasTypeBounds, HasVisibility,
+ },
};
/// The main trait to go from untyped `SyntaxNode` to a typed ast. The
{
Self::cast(self.syntax().clone_for_update()).unwrap()
}
+ fn clone_subtree(&self) -> Self
+ where
+ Self: Sized,
+ {
+ Self::cast(self.syntax().clone_subtree()).unwrap()
+ }
}
/// Like `AstNode`, but wraps tokens rather than interior nodes.
#[test]
fn assert_ast_is_object_safe() {
- fn _f(_: &dyn AstNode, _: &dyn NameOwner) {}
+ fn _f(_: &dyn AstNode, _: &dyn HasName) {}
}
#[test]