summaryrefslogtreecommitdiffstats
path: root/Tools/peg_generator
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] parser_generator.py typo - keywods -> keywords (GH-135014) (#136773)Miss Islington (bot)2025-07-191-1/+1
| | | | Co-authored-by: chemelnucfin <3982092+chemelnucfin@users.noreply.github.com>
* [3.13] gh-133157: fix UBSan failures in `Parser/pegen.c` (GH-134048) (#135334)Bénédikt Tran2025-06-101-22/+36
| | | | [3.13] gh-133157: fix UBSan failures in `Parser/pegen.c` (GH-134048) (cherry picked from commit 754e7c9b5187fcad22acf7555479603f173a4a09)
* [3.13] gh-132921: Fix setuptools._distutils.dep_util deprecation (#133522)Victor Stinner2025-05-061-1/+4
| | | | | | gh-132921: Fix setuptools._distutils.dep_util deprecation Get newer_group from setuptools.modified on recent setuptools versions, but keep support for old setuptools versions.
* [3.13] Revert "[3.13] gh-132921: Fix setuptools._distutils.dep_util ↵Victor Stinner2025-04-261-1/+1
| | | | | | | | | | deprecation (GH-132923) (#132926)" (#133004) Revert "[3.13] gh-132921: Fix setuptools._distutils.dep_util deprecation (GH-132923) (#132926)" This reverts commit 3776ade2e86010d638c538c5d3f225887d714478. setuptools.modified module is not available on old setuptools versions.
* [3.13] gh-132921: Fix setuptools._distutils.dep_util deprecation (GH-132923) ↵Miss Islington (bot)2025-04-251-1/+1
| | | | | | | | | | | (#132926) gh-132921: Fix setuptools._distutils.dep_util deprecation (GH-132923) Replace setuptools._distutils.dep_util with setuptools.modified in peg_generator compile_c_extension(). (cherry picked from commit 1a70f66ea856de1b1b0ca47baf9ee8ba6799ae18) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.13] gh-122270: Fix typos in the Py_DEBUG macro name (GH-122271) (GH-122275)Miss Islington (bot)2024-07-251-3/+3
| | | | | (cherry picked from commit 6c09b8de5c67406113e8d082e05c9587e35a852a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-118671: Updated dead ActiveState links (#118730)trag1c2024-05-081-2/+2
| | | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-116988: Remove duplicates of `annotated_rhs` in the Grammar (#117004)David Rubin2024-04-241-1/+1
|
* gh-112984: Fix link error on free-threaded Windows build (GH-114455)Sam Gross2024-01-231-0/+3
| | | | | | The test_peg_generator test tried to link the python313_d.lib library, which failed because the library is now named python313t_d.lib. The underlying problem is that the "compiler" attribute was not set when we call get_libraries() from distutils.
* gh-58032: Do not use argparse.FileType in module CLIs and scripts (GH-113649)Serhiy Storchaka2024-01-101-5/+4
| | | | | Open and close files manually. It prevents from leaking files, preliminary creation of output files, and accidental closing of stdin and stdout.
* gh-112532: Fix peg generator build.py for mimalloc build (gh-113492)Donghee Na2023-12-261-0/+1
| | | gh-112532: Fix peg generator for mimalloc build
* gh-111650: Ensure pyconfig.h includes Py_GIL_DISABLED on Windows (GH-112778)Steve Dower2023-12-131-0/+4
|
* GH-111807: Lower the parser stack depth under WASI debug builds (#112225)Brett Cannon2023-11-201-1/+5
|
* gh-110805: Fix test_peg_generator after the change in the parser for REPL ↵Pablo Galindo Salgado2023-10-131-1/+1
| | | | | tracebacks (#110814) Fix test_peg_generator after the change in the parser for REPL tracebacks
* gh-104169: Fix test_peg_generator after tokenizer refactoring (#110727)Lysandros Nikolaou2023-10-121-1/+10
| | | | * Fix test_peg_generator after tokenizer refactoring * Remove references to tokenizer.c in comments etc.
* gh-109596: Ensure repeated rules in the grammar are not allowed and fix ↵Pablo Galindo Salgado2023-09-221-1/+7
| | | | incorrect soft keywords (#109606)
* gh-108455: peg_generator: enable mypy's `--warn-unreachable` setting and ↵Alex Waygood2023-09-083-9/+13
| | | | `redundant-expr` error code (#109160)
* gh-108455: peg_generator: use `types-setuptools==68.1.0.1` in CI (#108697)Alex Waygood2023-08-312-10/+4
|
* gh-108455: peg_generator: install two stubs packages before running mypy ↵Alex Waygood2023-08-293-6/+13
| | | | (#108637)
* gh-108455: peg generator: Use `strict_optional=True` for `grammar_parser` ↵Nikita Sobolev2023-08-292-4/+1
| | | | (#108629)
* gh-108455: peg_generator: make the mypy config slightly stricter (#108627)Alex Waygood2023-08-294-8/+12
| | | | | | | | | * Enable `--no-implicit-reexport` * Enable the `truthy-bool` error code * Enable the `ignore-without-code` error code * Explicitly note that `--warn-unreachable` cannot yet be enabled
* gh-108455: Simplify the peg_generator mypy config (#108620)Alex Waygood2023-08-291-18/+8
| | | make it easier to see exactly which options from mypy's `--strict` mode can't currently be enabled
* gh-108455: Run `mypy` on `Tools/peg_generator` (#108456)Nikita Sobolev2023-08-284-9/+16
| | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-108179: Add error message for parser stack overflows (#108256)Dennis Sweeney2023-08-221-2/+1
|
* gh-107015: Remove async_hacks from the tokenizer (#107018)Pablo Galindo Salgado2023-07-262-5/+2
|
* gh-105191: Cleanup peg generator; keep only necessary files (#105197)Lysandros Nikolaou2023-06-0120-16832/+60
|
* gh-100238: Use setuptools in peg-generator and reenable tests (#104798)Lysandros Nikolaou2023-05-261-7/+47
|
* gh-104780: Remove 2to3 program and lib2to3 module (#104781)Victor Stinner2023-05-232-3/+1
| | | | | | | | | * Remove the Tools/scripts/2to3 script. * Remove the Lib/test/test_lib2to3/ directory. * Doc/tools/extensions/pyspecific.py: remove the "2to3fixer" object type. * Makefile and PC/layout/main.py no longer compile lib2to3 grammar files. * Update Makefile for 2to3 removal.
* gh-102856: Initial implementation of PEP 701 (#102855)Pablo Galindo Salgado2023-04-191-0/+1
| | | | | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Batuhan Taskaya <isidentical@gmail.com> Co-authored-by: Marta Gómez Macías <mgmacias@google.com> Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
* gh-102416: Do not memoize incorrectly loop rules in the parser (#102467)Pablo Galindo Salgado2023-03-061-2/+3
|
* gh-101046: Fix a potential memory leak in the parser when raising ↵Pablo Galindo Salgado2023-01-161-1/+1
| | | | MemoryError (#101051)
* gh-99300: Use Py_NewRef() in Parser/ directory (#99330)Victor Stinner2022-11-101-2/+1
| | | | Replace Py_INCREF() with Py_NewRef() in C files of the Parser/ directory and in the PEG generator.
* gh-84623: Remove unused imports (#94132)Victor Stinner2022-06-224-12/+1
|
* gh-54781: Move Lib/lib2to3/tests/ to Lib/test/test_lib2to3/ (#94049)Victor Stinner2022-06-212-2/+2
| | | | | | | | * Move Lib/lib2to3/tests/ to Lib/test/test_lib2to3/. * Remove Lib/test/test_lib2to3.py. * Update imports. * all_project_files(): use different paths and sort files to make the tests more reproducible. * Update references to tests.
* gh-93103: Parser uses PyConfig.parser_debug instead of Py_DebugFlag (#93106)Victor Stinner2022-05-241-1/+1
| | | | | | | * Replace deprecated Py_DebugFlag with PyConfig.parser_debug in the parser. * Add Parser.debug member. * Add tok_state.debug member. * Py_FrozenMain(): Replace Py_VerboseFlag with PyConfig.verbose.
* gh-90473: Decrease recursion limit and skip tests on WASI (GH-92803)Christian Heimes2022-05-191-1/+5
|
* gh-91320: Use _PyCFunction_CAST() (#92251)Victor Stinner2022-05-031-2/+2
| | | | | | | | | | Replace "(PyCFunction)(void(*)(void))func" cast with _PyCFunction_CAST(func). Change generated by the command: sed -i -e \ 's!(PyCFunction)(void(\*)(void)) *\([A-Za-z0-9_]\+\)!_PyCFunction_CAST(\1)!g' \ $(find -name "*.c")
* bpo-46576: Speed up test_peg_generator by using a static library for shared ↵Jeremy Kloth2022-04-062-42/+101
| | | | | sources (GH-32338) Speed up test_peg_generator by using a static library for shared sources to avoid recompiling as much code.
* Update grammar_grapher with the new forced (&&) directive (#31704)Luca Chiodini2022-03-061-0/+3
|
* Allow the parser to avoid nested processing of invalid rules (GH-31252)Pablo Galindo Salgado2022-02-101-2/+15
|
* bpo-46576: bpo-46524: Disable compiler optimization within ↵Gregory P. Smith2022-02-021-0/+10
| | | | | | | | | | | | | | | | | | | | test_peg_generator. (#31015) Disable compiler optimization within test_peg_generator. This speed up test_peg_generator by always disabling compiler optimizations by using -O0 or equivalent when the test is building its own C extensions. A build not using --with-pydebug in order to speed up test execution winds up with this test taking a very long time as it would do repeated compilation of parser C code using the same optimization flags as CPython was built with. This speeds the test up 6-8x on gps-raspbian. Also incorporate's #31017's win32 conditional and flags. Co-authored-by: Kumar Aditya kumaraditya303
* bpo-46110: Restore commit e9898bf153d26059261ffef11f7643ae991e2a4cPablo Galindo Salgado2022-01-031-4/+11
| | | This restores commit e9898bf153d26059261ffef11f7643ae991e2a4c .
* Revert "bpo-46110: Add a recursion check to avoid stack overflow in the PEG ↵Pablo Galindo Salgado2022-01-031-11/+4
| | | | | parser (GH-30177)" (GH-30363) This reverts commit e9898bf153d26059261ffef11f7643ae991e2a4c temporarily as we want to confirm if this commit is the cause of a slowdown at startup time.
* bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser ↵Pablo Galindo Salgado2021-12-201-4/+11
| | | | | (GH-30177) Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* bpo-45866: pegen strips directory of "generated from" header (GH-29777)Victor Stinner2021-11-263-3/+7
| | | | | "make regen-all" now produces the same output when run from a directory other than the source tree: when building Python out of the source tree.
* Refactor parser compilation units into specific components (GH-29676)Pablo Galindo Salgado2021-11-212-1/+3
|
* bpo-44257: fix "assigment_expr" typo + regenerate the grammar, and remove ↵wim glenn2021-11-031-2/+0
| | | | | | unused imports (GH-29393) Co-authored-by: Wim Glenn <wglenn@jumptrading.com>
* bpo-45494: Fix parser crash when reporting errors involving invalid ↵Pablo Galindo Salgado2021-10-191-1/+1
| | | | | | | | | | | | continuation characters (GH-28993) There are two errors that this commit fixes: * The parser was not correctly computing the offset and the string source for E_LINECONT errors due to the incorrect usage of strtok(). * The parser was not correctly unwinding the call stack when a tokenizer exception happened in rules involving optionals ('?', [...]) as we always make them return valid results by using the comma operator. We need to check first if we don't have an error before continuing.
* Fix typos in the Tools directory (GH-28769)Christian Clauss2021-10-063-3/+3
| | | | | | | Like #28744 but for the Tools directory. [skip issue] Opening a related issue is pending python/psf-infra-meta#130 Automerge-Triggered-By: GH:pablogsal
* [Tools/peg_generator/pegen/parser.py] Fix typo: s/wether/whether/ (GH-28739)Ikko Ashimine2021-10-051-1/+1
|