squawk_syntax/ast/
traits.rs1use crate::ast;
4use crate::ast::{AstNode, support};
5
6pub trait NameLike: AstNode {
7 fn text(&self) -> String;
8}
9
10pub trait HasCreateTable: AstNode {
11 #[inline]
12 fn path(&self) -> Option<ast::Path> {
13 support::child(self.syntax())
14 }
15
16 #[inline]
17 fn table_arg_list(&self) -> Option<ast::TableArgList> {
18 support::child(self.syntax())
19 }
20
21 #[inline]
22 fn persistence(&self) -> Option<ast::Persistence> {
23 support::child(self.syntax())
24 }
25
26 #[inline]
27 fn inherits(&self) -> Option<ast::Inherits> {
28 support::child(self.syntax())
29 }
30}
31
32pub trait HasWithClause: AstNode {
33 #[inline]
34 fn with_clause(&self) -> Option<ast::WithClause> {
35 support::child(self.syntax())
36 }
37}
38
39pub trait HasParamList: AstNode {
40 fn param_list(&self) -> Option<ast::ParamList> {
41 support::child(self.syntax())
42 }
43}