Parser: target module layout for splitting src/parser/mod.rs

オープン
#2,650 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
backend

調査の方向性

Start with src/parser/mod.rs and compare its structure with src/ast/; the proposed module layout and migration order are listed in this issue. Read the parent issue #2591 and inspect the existing parser files named in the layout to understand shared helpers and module boundaries. Done means the parser is split into the proposed modules in the listed order, with parsing behavior preserved.

索引モデルが issue の本文から書いたものです。

説明

Part of #2591, scoped to the parser only.

#2591 agreed on a series of pure-move PRs but did not fix the target layout. #944 and #1581 both went per-statement (~35 files, one per top-level keyword). #1581 stalled as one large
PR, and its author noted that shared helpers ended up placed arbitrarily.

Proposed layout

A flat layout mirroring src/ast/, so a struct in ast/ddl.rs is parsed in parser/ddl.rs:

src/parser/
  mod.rs        Parser struct, token cursor, errors, identifiers, lists, statement dispatch
  expr.rs       precedence climbing, prefix/infix, function calls, literals
  query.rs      SELECT, set ops, CTEs, FROM/joins, windows
  data_type.rs
  ddl.rs        CREATE TABLE, columns, constraints, DROP   (existing create.rs, alter.rs stay beside)
  dml.rs        INSERT / UPDATE / DELETE                   (existing merge.rs stays beside)
  dcl.rs        GRANT / REVOKE / roles / policies
  statement.rs  SHOW / SET / DECLARE / transactions / EXPLAIN / misc

Order

Smallest conflict surface first:

  • dcl
  • dml
  • data_type
  • statement
  • ddl
  • query
  • expr

@alamb @LucaCappelletti94 wdyt?

主要言語
Rust
スター
3.5k
フォーク
805
平均マージ
2日 3時間
マージ済み PR(30日)
116

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/datafusion-sqlparser-rs のほかの issue

apache/datafusion-sqlparser-rs の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。