-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Description
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
cpython/Doc/reference/grammar.rst
Lines 18 to 19 in 78a50ee
| .. literalinclude:: ../../Grammar/python.gram | |
| :language: peg |
and Grammar/python.gram has a section for invalid rules at the bottom.
Lines 1193 to 1202 in 78a50ee
| # ========================= END OF THE GRAMMAR =========================== | |
| # ========================= START OF INVALID RULES ======================= | |
| # From here on, there are rules for invalid syntax with specialised error messages | |
| invalid_arguments: | |
| | ((','.(starred_expression | ( assignment_expression | expression !':=') !'=')+ ',' kwargs) | kwargs) a=',' ','.(starred_expression !'=')+ { |
However, the content after START OF INVALID RULES is missing on the page
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
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).
Metadata
Metadata
Assignees
Labels
Projects
Status
Status

