Document token spacing
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 28/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- rust
調査の方向性
lexer の章と既存の macro.proc.token.conversion.from-proc_macro セクションから始め、次に rustc_parse/src/parser/mod.rs の break_and_eat 周辺を調べます。構文の概要における連結されたトークンの扱いを、参照パターンおよび借用演算子と比較し、リンクされている issue と pull request を確認します。Reference がトークンの空白、分割または結合、および lexer/parser の境界を明確に定義していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I think the behavior around token splitting should be documented in some way, though I'm uncertain exactly how. The general idea is that the lexer chapter defines tokens, such as <-, which are then split in certain situations to smaller tokens. AFAIK, the reference doesn't really define how this works. I also don't know how much of this is part of the lexer versus the parser. I suspect it needs to be addressed in both depending on which approach we take.
A question I have is whether it should be documented as tokens being split, or tokens being glued, since I could imagine either approach is viable.
I think in rustc, currently the primary method that is used to handle this is break_and_eat. However, I may be misremembering if there are other places where this is handled.
IIUC, the places where this splitting happens is somewhat arbitrary, in terms of places where people thought it would be helpful. There's nothing that prevents the parser from avoiding those splitting methods.
There is a brief mention in macro.proc.token.conversion.from-proc_macro how proc-macro output is glued/split. The proc-macro Spacing type briefly touches on it as well.
Note that reference patterns and borrow operators specifically include the && token in their grammar. I don't remember the exact details about why we did it that way (that is, why did we do this just for && and no other token?). Depending on how we approach this, we may need to consider how that might need to change.
Note that I included some of the jointed tokens in the syntax summary. We may want to remove some. For example, I have >>= and >= linking to generics.
Some relevant links:
- 主要言語
- Rust
- スター
- 1.6k
- フォーク
- 618
- 平均マージ
- 5時間 48分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-lang/reference のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
A-const-eval A-undefined-behavior
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rust-lang/reference#2266 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
A-resolve
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
rust-lang/reference の issue をすべて見る
似ている issue
-
good first issue help wanted program
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
hffgzktbcc-blip/ounce-core#297 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nautechsystems/nautilus_trader#5631 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
bytecodealliance/rustix#1736 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
longbridge/gpui-kit#3871 ·
メンテナーはふだん 1 日以内に返信
-
area:models enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信