Skip to content

GFQL Cypher parser: remove the WHERE flatten seam (assembler should consume MatchClause.where directly) #1687

Description

@lmeyerov

Follow-up from the Earley→LALR parser PR (#1682).

Context

The LALR grammar bundles a trailing WHERE into its match_clause (so WHERE binds to its preceding clause declaratively, which eliminated the WITH..WHERE attachment ambiguity). To keep that change AST-byte-identical, the query_body transformer currently re-flattens a bundled MatchClause(where=…) back into a [match, where] item sequence so the pre-existing clause-sequence assembler (a state machine that predates the bundling) runs untouched.

Ask

Have the assembler consume MatchClause.where directly and delete the positional WHERE-attachment inference. Re-prove equivalence with the existing differentials (test_grammar_invariants.py + test_differential_grammar_parity.py — byte-identical ASTs, rejection parity). With the seam gone, the AST's WHERE-related fields may also be simplified (the AST is an internal contract, safe to redesign with consumers refactored in lockstep + differential re-proven).

Scoped, low-risk, no new machinery. Parser-only.

🤖 tracked via Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions