bpo-43244: test_peg_generator defines _Py_TEST_PEGEN macro by vstinner · Pull Request #24912 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 4 additions & 30 deletions Parser/asdl_c.py
3 changes: 2 additions & 1 deletion Parser/pegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,8 @@ _PyPegen_run_parser(Parser *p)
return RAISE_SYNTAX_ERROR("multiple statements found while compiling a single statement");
}

#if defined(Py_DEBUG) && defined(Py_BUILD_CORE)
// test_peg_generator defines _Py_TEST_PEGEN to not call PyAST_Validate()
#if defined(Py_DEBUG) && !defined(_Py_TEST_PEGEN)
if (p->start_rule == Py_single_input ||
p->start_rule == Py_file_input ||
p->start_rule == Py_eval_input)
Expand Down
256 changes: 5 additions & 251 deletions Python/Python-ast.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Tools/peg_generator/pegen/build.py