python / python/cpython

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

未關閉
#142,714 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

docs topic-parser
主要語言
Python
星號
77.2k
分支
36k
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. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 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 摘要。