linkrs_query/parser/parsing/
ddl_parser.rs1mod alter_parser;
2mod create_parser;
3mod describe_parser;
4mod drop_parser;
5mod helpers;
6
7use crate::parser::core::error::ParseError;
8use crate::parser::parsing::parse_context::ParseContext;
9use crate::parser::TokenKind;
10
11pub struct DdlParser;
12
13impl DdlParser {
14 pub fn new() -> Self {
15 Self
16 }
17}
18
19pub(crate) fn consume_space_or_graph(ctx: &mut ParseContext) -> Result<bool, ParseError> {
23 if ctx.match_token(TokenKind::Space) {
24 return Ok(true);
25 }
26 if ctx.check_keyword("GRAPH") {
27 ctx.consume_keyword("GRAPH")?;
28 return Ok(true);
29 }
30 Ok(false)
31}
32
33impl Default for DdlParser {
34 fn default() -> Self {
35 Self::new()
36 }
37}