pub struct Parser;Expand description
Canonical QQL parser facade.
Production parsing is only the hand-written AST lowerer
(lexer → tokens → typed AST). There is no parallel PEG/pest frontend in
this crate: language/v1/grammar.pest is the language contract for docs
and CI (qql-grammar-gen), not a runtime dependency of qql-core.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn parse(input: &str) -> Result<Stmt, QqlError>
pub fn parse(input: &str) -> Result<Stmt, QqlError>
Parses a single QQL statement from the input string.
Sourcepub fn parse_all(input: &str) -> Result<Vec<Stmt>, QqlError>
pub fn parse_all(input: &str) -> Result<Vec<Stmt>, QqlError>
Parses a ;-separated script into a list of statements.
Sourcepub fn parse_all_with_spans(input: &str) -> Result<Vec<(Stmt, Span)>, QqlError>
pub fn parse_all_with_spans(input: &str) -> Result<Vec<(Stmt, Span)>, QqlError>
Parses a script, returning each statement paired with its source span.
Sourcepub fn parse_all_recovering(input: &str) -> RecoveredScript
pub fn parse_all_recovering(input: &str) -> RecoveredScript
Parse a script in panic-mode recovery: sync on ; or the next
statement keyword and collect every recoverable error.
Self::parse / Self::parse_all stay fail-fast — execution must
not run a partial script. This entry point is for IDEs, analyze, and
other diagnostic surfaces that want every span in one pass.