]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Thoroughly refactor the cases generator (#107151)
authorGuido van Rossum <guido@python.org>
Mon, 24 Jul 2023 16:38:23 +0000 (09:38 -0700)
committerGitHub <noreply@github.com>
Mon, 24 Jul 2023 16:38:23 +0000 (09:38 -0700)
commit032f4809094bf03d92c54e46b305c499ef7e3165
treec48dfaa67e6201d3ee3c65682081701f0479ec99
parentff5f94b72c8aad8e45c397c263dbe7f19221735f
Thoroughly refactor the cases generator (#107151)

This mostly extracts a whole bunch of stuff out of generate_cases.py into separate files, but there are a few other things going on here.

- analysis.py: `Analyzer` etc.
- instructions.py: `Instruction` etc.
- flags.py: `InstructionFlags`, `variable_used`, `variable_used_unspecialized`
- formatting.py: `Formatter` etc.
- Rename parser.py to parsing.py, to avoid conflict with stdlib parser.py
- Blackify most things
- Fix most mypy errors
- Remove output filenames from Generator state, add them to `write_instructions()` etc.
- Fix unit tests
Lib/test/test_generated_cases.py
Tools/cases_generator/analysis.py [new file with mode: 0644]
Tools/cases_generator/flags.py [new file with mode: 0644]
Tools/cases_generator/formatting.py [new file with mode: 0644]
Tools/cases_generator/generate_cases.py
Tools/cases_generator/instructions.py [new file with mode: 0644]
Tools/cases_generator/parsing.py [moved from Tools/cases_generator/parser.py with 96% similarity]