From 13e664a56e609ad4f8331cfc1016dac9df7e8f20 Mon Sep 17 00:00:00 2001 From: chemelnucfin <3982092+chemelnucfin@users.noreply.github.com> Date: Sat, 20 Sep 2025 21:12:06 -0700 Subject: [PATCH 1/3] Clarified issue in using the existing Grammar/python.gram file. --- InternalDocs/parser.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/InternalDocs/parser.md b/InternalDocs/parser.md index 1d0ffe6d40d078..d58bd10ae8590e 100644 --- a/InternalDocs/parser.md +++ b/InternalDocs/parser.md @@ -829,6 +829,10 @@ $ python parse.py file_with_source_code_to_test.py As the generated `parse.py` file is just Python code, you can modify it and add breakpoints to debug or better understand some complex situations. +However, this does not work with the existing `Grammar/python.gram` file. +See [#133560](https://github.com/python/cpython/issues/133560) +and [#96424](https://github.com/python/cpython/issues/96424) for more information. + Verbose mode ------------ From 6c2425c0c9c8ee7d4dd52de4d32974fd74fc6947 Mon Sep 17 00:00:00 2001 From: chemelnucfin <3982092+chemelnucfin@users.noreply.github.com> Date: Sun, 21 Sep 2025 18:58:51 -0700 Subject: [PATCH 2/3] Changed parser.md pegen note to using Caution note block in more appropriate location. --- InternalDocs/parser.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/InternalDocs/parser.md b/InternalDocs/parser.md index d58bd10ae8590e..121d60690393cc 100644 --- a/InternalDocs/parser.md +++ b/InternalDocs/parser.md @@ -819,6 +819,12 @@ directory on the CPython repository and manually call the parser generator by ex $ python -m pegen python ``` +> [!CAUTION] +> This grammar file has to be specific to Python and does not work with the existing +> C language based`Grammar/python.gram` file. +> See [#133560](https://github.com/python/cpython/issues/133560) +> and [#96424](https://github.com/python/cpython/issues/96424) for more information. + This will generate a file called `parse.py` in the same directory that you can use to parse some input: @@ -829,10 +835,6 @@ $ python parse.py file_with_source_code_to_test.py As the generated `parse.py` file is just Python code, you can modify it and add breakpoints to debug or better understand some complex situations. -However, this does not work with the existing `Grammar/python.gram` file. -See [#133560](https://github.com/python/cpython/issues/133560) -and [#96424](https://github.com/python/cpython/issues/96424) for more information. - Verbose mode ------------ From e00771d5f297873edd393502038304bb246a1bd0 Mon Sep 17 00:00:00 2001 From: chemelnucfin <3982092+chemelnucfin@users.noreply.github.com> Date: Sun, 21 Sep 2025 21:13:03 -0700 Subject: [PATCH 3/3] missed space --- InternalDocs/parser.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InternalDocs/parser.md b/InternalDocs/parser.md index 121d60690393cc..8ce48a9acd01ac 100644 --- a/InternalDocs/parser.md +++ b/InternalDocs/parser.md @@ -821,7 +821,7 @@ $ python -m pegen python > [!CAUTION] > This grammar file has to be specific to Python and does not work with the existing -> C language based`Grammar/python.gram` file. +> C language based `Grammar/python.gram` file. > See [#133560](https://github.com/python/cpython/issues/133560) > and [#96424](https://github.com/python/cpython/issues/96424) for more information.