Title: "python3 -m pegen python" generates a Python parser that contains invalid code · Issue #133560 · python/cpython · GitHub
Open Graph Title: "python3 -m pegen python" generates a Python parser that contains invalid code · Issue #133560 · python/cpython
X Title: "python3 -m pegen python" generates a Python parser that contains invalid code · Issue #133560 · python/cpython
Description: Bug report Bug description: I am currently experimenting with the cpython parser/tokenizer, following the parser documentation: $ python3.14 -m pegen python ../../Grammar/python.gram This generates a parser.py file, that contains remnant...
Open Graph Description: Bug report Bug description: I am currently experimenting with the cpython parser/tokenizer, following the parser documentation: $ python3.14 -m pegen python ../../Grammar/python.gram This generates...
X Description: Bug report Bug description: I am currently experimenting with the cpython parser/tokenizer, following the parser documentation: $ python3.14 -m pegen python ../../Grammar/python.gram This generates...
Opengraph URL: https://github.com/python/cpython/issues/133560
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"python3 -m pegen python\" generates a Python parser that contains invalid code","articleBody":"# Bug report\n\n### Bug description:\n\nI am currently experimenting with the cpython parser/tokenizer, following the [parser documentation](https://github.com/python/cpython/blob/main/InternalDocs/parser.md):\n\n```bash\n$ python3.14 -m pegen python ../../Grammar/python.gram\n```\n\nThis generates a `parser.py` file, that contains remnants of C code:\n\n```\n# line 34\nreturn _PyAST_FunctionType ( a , b , p -> arena )\n\n# end of file\nvoid *\n_PyPegen_parse(Parser *p)\n{\n // Initialize keywords\n p->keywords = reserved_keywords;\n p->n_keyword_lists = n_keyword_lists;\n p->soft_keywords = soft_keywords;\n\n // Run parser\n```\n\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-139194\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/alexprengere","@type":"Person","name":"alexprengere"},"datePublished":"2025-05-07T08:36:36Z","url":"https://github.com/python/cpython/issues/133560"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8fd662e5-2d1c-d245-d662-5b191bf05261 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D9D4:38EE04:1832CEA:1FF2753:6B020AD9 |
| html-safe-nonce | 34c9100e7eb94dbf57a230d30f63a773e55ceb28a36209b547f62c8b9d425aee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUQ0OjM4RUUwNDoxODMyQ0VBOjFGRjI3NTM6NkIwMjBBRDkiLCJ2aXNpdG9yX2lkIjoiMjA1Njg1OTM0NTkyODQ1NjkyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f49a65512e3bf26dd4e2dc61020676c0e63b649b5345b284ea2de69501fe56aa |
| hovercard-subject-tag | issue:3045172321 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/133560/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ccedd004756cf1d4fb2f5a6f1825854f404bf4a4a7bac09e2807be6d2ea98b11/python/cpython/issues/133560 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ccedd004756cf1d4fb2f5a6f1825854f404bf4a4a7bac09e2807be6d2ea98b11/python/cpython/issues/133560 |
| og:image:alt | Bug report Bug description: I am currently experimenting with the cpython parser/tokenizer, following the parser documentation: $ python3.14 -m pegen python ../../Grammar/python.gram This generates... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alexprengere |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width