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 HasArgList: AstNode {
13 fn arg_list(&self) -> Option<ast::ArgList> {
14 support::child(self.syntax())
15 }
16}
17
18pub trait HasIfExists: AstNode {
19 fn if_exists(&self) -> Option<ast::IfExists> {
20 support::child(self.syntax())
21 }
22}
23
24pub trait HasIfNotExists: AstNode {
25 fn if_not_exists(&self) -> Option<ast::IfNotExists> {
26 support::child(self.syntax())
27 }
28}