Skip to main content

open_cypher/
lib.rs

1//! An unofficial, syntax-only lexer and parser targeting openCypher 2024.3.
2//!
3//! The crate exposes a lossless token stream, an owned and spanned AST, and
4//! structured diagnostics. It deliberately does not perform semantic analysis
5//! or query execution.
6
7#![forbid(unsafe_code)]
8
9pub mod ast;
10pub mod diagnostic;
11pub mod lexer;
12pub mod parser;
13pub mod span;
14pub mod token;
15
16pub use diagnostic::{Diagnostic, DiagnosticCode, Label, ParseErrors, Severity};
17pub use lexer::{LexOutcome, lex};
18pub use parser::{ParseOutcome, ParsedProgram, parse, parse_recovering};
19pub use span::Span;
20pub use token::{Keyword, Token, TokenKind};
21
22/// The upstream openCypher language release used as this crate's pinned baseline.
23pub const OPEN_CYPHER_GRAMMAR_VERSION: &str = "2024.3";
24
25/// The immutable upstream Git revision containing the language snapshot.
26pub const OPEN_CYPHER_GRAMMAR_REVISION: &str = "677cbafabb8c3c5eed458fd3b1ec0daec8d67d23";