Skip to main content

graphforge_ast/
lib.rs

1//! GraphForge AST — syntax-faithful, span-rich parse tree.
2//!
3//! The AST is internal to the compiler pipeline. `graphforge-cypher` produces it;
4//! `graphforge-ir` consumes it. No other crate should depend on this crate directly.
5//!
6//! # Module layout
7//!
8//! - [`token`] — `Token` enum and `Keyword` enum (frozen lexer ABI)
9//! - [`parse_error`] — `ParseError` and `ParseErrorKind`
10//! - [`ast`] — all AST node types
11#![forbid(unsafe_code)]
12
13pub mod ast;
14pub mod parse_error;
15pub mod token;
16
17// Flat re-exports for convenience
18pub use ast::{
19    AstClause, AstQuery, BinaryOp, BinaryOpKind, CallClause, CaseExpr, CreateClause, DeleteClause,
20    DialectVersion, Direction, ExistentialSubquery, ExistentialSubqueryBody, Expr, FunctionCall,
21    LabelPredicate, ListComprehension, ListLiteral, Literal, MapLiteral, MatchClause, MergeClause,
22    NodePattern, OrderByClause, ParamRef, PathElement, PathPattern, PatternComprehension,
23    PatternPredicate, PropertyAccess, Quantifier, QuantifierKind, RelPattern, RemoveClause,
24    RemoveItem, ReturnClause, ReturnItem, SetClause, SetItem, SortItem, SortOrder, StringOpKind,
25    UnaryOp, UnaryOpKind, UnionClause, UnwindClause, VarRef, WhenClause, WhereClause, WithClause,
26};
27pub use graphforge_core::Span;
28pub use parse_error::{ParseError, ParseErrorKind};
29pub use token::{Keyword, Token};
30
31#[cfg(test)]
32mod tests;