squawk_syntax/ast/
traits.rs1use crate::ast;
4use crate::ast::{AstNode, support};
5
6pub trait HasName: AstNode {
7 fn name(&self) -> Option<ast::Name> {
8 support::child(self.syntax())
9 }
10}
11
12pub trait NameLike: AstNode {}
13
14pub trait HasArgList: AstNode {
15 fn arg_list(&self) -> Option<ast::ArgList> {
16 support::child(self.syntax())
17 }
18}
19
20pub trait HasParamList: AstNode {
21 fn param_list(&self) -> Option<ast::ParamList> {
22 support::child(self.syntax())
23 }
24}
25
26pub trait HasIfExists: AstNode {
27 fn if_exists(&self) -> Option<ast::IfExists> {
28 support::child(self.syntax())
29 }
30}
31
32pub trait HasIfNotExists: AstNode {
33 fn if_not_exists(&self) -> Option<ast::IfNotExists> {
34 support::child(self.syntax())
35 }
36}