python / python/cpython

The elements in `Grammar/python.gram` stripped by `peg_lexer.py` still shows in generated PO files

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

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

docs topic-parser
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

My original question has answered by Stan. I leave it here as a record:

Click to expand

I'm not sure if it's done deliberately, but it seems odd to me and I can't find out why it happens so far.


The reference/grammar.rst includes Grammar/python.gram

https://github.com/python/cpython/blob/78a50ee10ef73296eba98899d496bff3915ddc41/Doc/reference/grammar.rst#L18-L19

and Grammar/python.gram has a section for invalid rules at the bottom.

https://github.com/python/cpython/blob/78a50ee10ef73296eba98899d496bff3915ddc41/Grammar/python.gram#L1193-L1202

However, the content after START OF INVALID RULES is missing on the page

snapshot Image

I checked the previous version and found out the doc has this issue since 3.11 (after PEG parser is introduced).


Other info:
I translated this page into Traditional Chinese (zh-tw) recently and somehow it shows correctly on the translated page

snapshot Image

So here's the revised issue description:

Some elements in Grammar/python.gram are stripped by peg_lexer.py, and hence they're hidden on the reference/grammar docs. However, the full content of Grammar/python.gram is still remained in the generated PO files (e.g. the one in zh-tw).

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

Doc/tools/extensions/lexers/peg_lexer.py から始め、Grammar/python.gram の扱いを Doc/reference/grammar.rst への組み込みと比較してください。生成された reference/grammar.po の例を調べ、除去された内容がどこに残るのかを確認してください。Done では、レンダリングされたドキュメントと生成された PO ファイルの両方で、期待される扱いを定義し、一貫して適用する必要があります。

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

評価

技術スタック
python
領域
documentation, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

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

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