Skip to content

Rewrite parser for openCypher 2024.3 - #4

Merged
a-poor merged 7 commits into
mainfrom
feat/rewrite
Aug 23, 2026
Merged

Rewrite parser for openCypher 2024.3#4
a-poor merged 7 commits into
mainfrom
feat/rewrite

Conversation

@a-poor

@a-poor a-poor commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace the Pest frontend with a lossless Logos lexer and generated LALRPOP parser.
  • Add a public typed and spanned AST, structured diagnostics, strict parsing, and recovering parsing APIs.
  • Target the pinned openCypher 2024.3 grammar and add an offline syntax projection of the upstream TCK.
  • Add exact AST and span contracts, property tests, fuzz targets and seeds, Criterion benchmarks, coverage gates, and Rust 1.88 compatibility checks.
  • Fix contextual-keyword parsing performance and correctness, including literal preservation and exact standalone YIELD spans.
  • Harden checked-in parser generation with layout invariants and atomic replacement.

Verification

  • Workspace tests pass with default and all features.
  • Rust 1.88 workspace and independent fuzz workspace checks pass.
  • Clippy passes for all targets and features with warnings denied.
  • Rustdoc, formatting, benchmark compilation, expanded property tests, fuzz corpus replay, coverage, and local package verification pass.
  • The openCypher release gate covers all 377 BNF productions and matches all 4,882 projected TCK occurrences with zero exclusions or open deviations.

Breaking changes

This is the planned 0.2 rewrite. It replaces the public Pest Rule and Pairs API with project-owned tokens, AST nodes, spans, and diagnostics. Migration guidance is included in docs/migration-from-0.1.md.

Known limitation

Label-heavy expression parsing still has nonlinear scaling. The benchmark suite now measures it from 4 through 64 KiB against a same-sized property-access control; this is tracked as performance debt rather than a correctness or merge blocker.

a-poor added 7 commits August 22, 2026 19:09
- Completed parser coverage: contextual keywords, CALL forms, path quantifiers/subpaths, pattern expressions, subqueries, labels, parameters, and precedence.
- Added exhaustive conformance tooling: 4,882/4,882 projected TCK cases and traceability for all 377 BNF productions.
- Added 235 executable witnesses and documented 20 intentional deviations; none remain open.
- Tightened lexer/API behavior, including exact keyword classification, Unicode parameter names, and rejecting bare ~.
- Expanded tests, property testing, five fuzz targets, TCK/scaling benchmarks, coverage enforcement, and CI.
- Raised MSRV from Rust 1.86 to 1.88.
- Fixed a parser hotspot, reducing the 100 KiB stress case from roughly 6–7 seconds to about 30 ms.
- Updated documentation to accurately describe scope and conformance.
@a-poor
a-poor marked this pull request as ready for review August 23, 2026 17:59
@a-poor
a-poor merged commit cae56d7 into main Aug 23, 2026
13 checks passed
@a-poor
a-poor deleted the feat/rewrite branch August 23, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant