1use either::Either;
12
13use crate::ast::{self, support, AstNode};
14
15pub trait HasName: AstNode {
16 fn name(&self) -> Option<ast::Name> {
17 support::child(self.syntax())
18 }
19}
20
21pub trait HasLoopBody: AstNode {
22 fn loop_body(&self) -> Option<ast::BlockExpr> {
23 support::child(self.syntax())
24 }
25}
26
27pub trait HasArgList: AstNode {
28 fn arg_list(&self) -> Option<ast::ArgList> {
29 support::child(self.syntax())
30 }
31}
32
33impl<A: HasName, B: HasName> HasName for Either<A, B> {}