Skip to content

feat: SQL, GraphQL, and Protobuf component extraction#31

Open
bionicles wants to merge 1 commit into
mainfrom
rust-sql-graphql-proto
Open

feat: SQL, GraphQL, and Protobuf component extraction#31
bionicles wants to merge 1 commit into
mainfrom
rust-sql-graphql-proto

Conversation

@bionicles

Copy link
Copy Markdown
Owner

Item 3 of the post-port roadmap: the cheap, popular line formats.

What

Line-oriented ports of legacy parse_sql / parse_graphql / parse_grpc in extract/simple.rs (the home of the other line formats):

  • SQL (.sql): CREATE TABLE name (body); statements via a dotall regex; body lines re-emitted under a 3-space indent.
  • GraphQL (.graphql): type/enum headers without the trailing brace; every other non-comment line indented; bare } lines skipped.
  • Protobuf (.proto): syntax/service/message/rpc lines plus =-bearing field lines (field numbers kept, ; tail dropped).

Acceptance

  • sql_test.sql, test.graphql, test.proto component sets match the legacy goldens byte-for-byte; extensions added to the v1 parity scope in golden_parity.rs.
  • trees_v1 goldens regenerated with the three parsers unstubbed; all 13 tree-render parity tests pass.
  • Robustness garbage-input coverage extended to .sql/.graphql/.proto.
  • 81 tests, stable clippy -D warnings clean, fmt clean.

Note: independent of #29 and #30 (branched from main); expect a trivial dispatch-table conflict with #29 on merge, whichever lands second.

🤖 Generated with Claude Code

Line-oriented ports of legacy parse_sql / parse_graphql / parse_grpc in
extract/simple.rs:

- SQL: CREATE TABLE statements (dotall regex), body lines re-emitted
  under a 3-space indent;
- GraphQL: type/enum headers sans brace, other non-comment lines
  indented, bare closing braces skipped;
- Protobuf: syntax/service/message/rpc lines plus '='-bearing field
  lines with field numbers kept.

All three fixture component sets match the legacy goldens byte-for-byte
(.sql/.graphql/.proto added to v1 parity scope); trees_v1 goldens
regenerated with those parsers unstubbed; robustness garbage-input
coverage extended to the three extensions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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