cpython/Tools/peg_generator/pegen
efimov-mikhail 1f9025a4e7
gh-124889: Remove redundant artificial rules in PEG parser (#124893)
Cache in C PEG-generator reworked:
we save artificial rules in cache by Node string representation as a key instead of Node object itself.
As a result total count of artificial rules in parsers.c is lowered from 283 to 170.
More natural number ordering is used for the names of artificial rules.

Auxiliary method CCallMakerVisitor._generate_artificial_rule_call is added.
Its purpose is abstracting work with artificial rules cache.

Explicit using of "is_repeat1" kwarg is added to visit_Repeat0 and visit_Repeat1 methods.
Its slightly improve code readabitily.
2024-10-03 13:58:56 +01:00
..
__init__.py
__main__.py gh-116991: Improve `pygen --help` for `python` subparser (#116992) 2024-06-03 10:52:35 +03:00
ast_dump.py gh-108455: peg_generator: enable mypy's `--warn-unreachable` setting and `redundant-expr` error code (#109160) 2023-09-08 22:05:40 +01:00
build.py gh-112984: Fix link error on free-threaded Windows build (GH-114455) 2024-01-23 18:05:15 +00:00
c_generator.py gh-124889: Remove redundant artificial rules in PEG parser (#124893) 2024-10-03 13:58:56 +01:00
first_sets.py Fix typos in the Tools directory (GH-28769) 2021-10-06 10:55:16 -07:00
grammar.py gh-109596: Ensure repeated rules in the grammar are not allowed and fix incorrect soft keywords (#109606) 2023-09-22 19:03:23 +01:00
grammar_parser.py bpo-45866: pegen strips directory of "generated from" header (GH-29777) 2021-11-26 11:50:34 +01:00
grammar_visualizer.py gh-105191: Cleanup peg generator; keep only necessary files (#105197) 2023-06-01 17:24:15 +02:00
keywordgen.py gh-58032: Do not use argparse.FileType in module CLIs and scripts (GH-113649) 2024-01-10 15:07:19 +02:00
metagrammar.gram Update pegen to use the latest upstream developments (GH-27586) 2021-08-12 17:37:30 +01:00
parser.py gh-108455: peg_generator: make the mypy config slightly stricter (#108627) 2023-08-29 11:23:22 +00:00
parser_generator.py gh-124889: Remove redundant artificial rules in PEG parser (#124893) 2024-10-03 13:58:56 +01:00
python_generator.py Fix types in pegen parser generator (GH-120720) 2024-06-19 16:12:40 +02:00
sccutils.py gh-118671: Updated dead ActiveState links (#118730) 2024-05-08 01:06:38 -06:00
testutil.py gh-108455: peg_generator: install two stubs packages before running mypy (#108637) 2023-08-29 20:14:08 +01:00
tokenizer.py Update pegen to use the latest upstream developments (GH-27586) 2021-08-12 17:37:30 +01:00
validator.py gh-118235: Move RAISE_SYNTAX_ERROR actions to invalid rules and make sure they stay there (GH-119731) 2024-05-30 09:27:32 +02:00