Skip to main content

Module parser

Module parser 

Source
Expand description

Recursive-descent parser for the Cypher subset. Never panics on any token sequence.

Structs§

UnionQuery
A read query that may be a single query or a UNION / UNION ALL chain. all_flags[i] is true when the boundary before parts[i + 1] was UNION ALL (bag union); false for UNION (distinct). Length is parts.len() - 1.

Functions§

is_write_tokens
Return true if the token stream starts with a write keyword, or is a MATCH statement followed by SET or DELETE. Used for fast server-side dispatch without a full parse.
parse
Parse a tokenized Cypher subset query. Every failure is Err(String); this function never panics on a well-formed &[Tok] (including empty / garbage).
parse_read
Parse a read query, accepting a UNION / UNION ALL chain.
parse_write
Parse a tokenized write statement (CREATE / MATCH…SET / MATCH…DELETE / MERGE). Returns Err for read queries or malformed write statements.