python / python/cpython

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

Abierto
#142,714 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

docs topic-parser
Lenguaje dominante
Python
Estrellas
77.2k
Forks
35.9k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

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).

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con Doc/tools/extensions/lexers/peg_lexer.py y compara su tratamiento de Grammar/python.gram con la inclusión en Doc/reference/grammar.rst. Inspecciona el ejemplo generado en reference/grammar.po para entender dónde permanece el contenido eliminado. Done debe definir y aplicar de forma coherente el tratamiento esperado tanto en la documentación renderizada como en los archivos PO generados.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
documentation, tooling
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.