spike: 006 grammar-slice viability for SELECT core - #67
Merged
Conversation
Slices the V2 SELECT-core subset out of pomelo (spike 001's chosen toolchain) against .openspec/grammar/sqlite.ebnf's V-block tags: no CREATE TABLE/INSERT/UPDATE/DELETE (V3) or GROUP BY/HAVING/joins/ subqueries (V4) productions exist in the grammar at all. Confirms: - the slice accepts exactly the V2 subset with 3-way outcome parity (accept / unsupported / syntax error), via a keyword-sniff layer above the parser rather than dead grammar rules - BETWEEN/IN/LIKE (incl. NOT-prefixed forms) cause no LALR conflicts when spliced into the sliced precedence table - growing to V3 (INSERT sketched) is additive-only: ~20 new lines, 2 lines touched on the existing single-alternative stmt rule, no restructuring GO — recommends pomelo, sliced per sqlite.ebnf, for the phase-1 parser ticket (#61). Also fixes 002-parser/spec.md's stale "Decision: lemon-rs" line, superseded by spike 001's actual pomelo recommendation. Refs: 002/Req-2 Spend: within 1-2 day timebox (no formal Complexity section on issue). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
iheitlager
force-pushed
the
spike/006_grammar_slice
branch
from
August 15, 2026 10:07
b9afe7f to
254a243
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/spike/006_grammar_slice/, a real pomelo crate implementing only the(* V2 *)-tagged rules in.openspec/grammar/sqlite.ebnf(no CREATE TABLE/INSERT/UPDATE/DELETE, no GROUP BY/HAVING/joins/subqueries — those productions don't exist in this grammar at all)..openspec/specs/002-parser/spec.md(said "lemon-rs", spike 001 actually recommended pomelo) discovered along the way.Changes
Added
tests/spike/006_grammar_slice/— sliced pomelo grammar/tokenizer/AST,Outcome::{Accepted,Unsupported,SyntaxError}classification, fixtures (v2_valid.sql,unsupported.sql,invalid.sql), integration tests,FINDINGS.mdwriteup.spike-006Makefile target, following the existingspike-00Nconvention.Changed
.openspec/specs/002-parser/spec.md— corrected the parser-toolchain decision from lemon-rs to pomelo (matches spike 001's actual recommendation) and cross-referenced spike 006's outcome.Findings (see
tests/spike/006_grammar_slice/FINDINGS.mdfor full detail)src/unsupported.rs), not via grammar-level dead rules — recommended shape for the real parser API boundary.stmtrule, zero restructuring.NOT-prefixed forms) — the LALR slicing-trap candidates called out in the issue — spliced in without conflict.Recommendation for #61 (phase-1 parser ticket): proceed with pomelo, sliced per
sqlite.ebnf, using this spike's accept/unsupported/syntax-error split as the parser-boundary shape.Testing
cargo testin the spike crate: 4/4 green (22 V2-valid, 11 unsupported, 9 invalid fixture statements)make test(full suite) — unaffected, still greenmake grammar-drift— unaffected, no driftSpend
Estimate: 1-2 day timebox (issue carried no formal
## Complexitysection). Actual: single AI session, within timebox.Related Issues
Closes #57
🤖 Generated with Claude Code