summaryrefslogtreecommitdiffstats
path: root/Tools/peg_generator
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-03-23 23:51:50 (GMT)
committerGitHub <noreply@github.com>2021-03-23 23:51:50 (GMT)
commita81fca6ec8e0f748f8eafa12fb12cf9e12df465c (patch)
tree955b952d9953f5ba3ed487512ac9f67267ddd4f4 /Tools/peg_generator
parentf0a6fde8827d5d4f7a1c741ab1a8b206b66ffd57 (diff)
downloadcpython-a81fca6ec8e0f748f8eafa12fb12cf9e12df465c.zip
cpython-a81fca6ec8e0f748f8eafa12fb12cf9e12df465c.tar.gz
cpython-a81fca6ec8e0f748f8eafa12fb12cf9e12df465c.tar.bz2
bpo-43244: Add pycore_compile.h header file (GH-25000)
Remove the compiler functions using "struct _mod" type, because the public AST C API was removed: * PyAST_Compile() * PyAST_CompileEx() * PyAST_CompileObject() * PyFuture_FromAST() * PyFuture_FromASTObject() These functions were undocumented and excluded from the limited C API. Rename functions: * PyAST_CompileObject() => _PyAST_Compile() * PyFuture_FromASTObject() => _PyFuture_FromAST() Moreover, _PyFuture_FromAST() is no longer exported (replace PyAPI_FUNC() with extern). _PyAST_Compile() remains exported for test_peg_generator. Remove also compatibility functions: * PyAST_Compile() * PyAST_CompileEx() * PyFuture_FromAST()
Diffstat (limited to 'Tools/peg_generator')
-rw-r--r--Tools/peg_generator/peg_extension/peg_extension.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Tools/peg_generator/peg_extension/peg_extension.c b/Tools/peg_generator/peg_extension/peg_extension.c
index 96d3a52..f2a870e 100644
--- a/Tools/peg_generator/peg_extension/peg_extension.c
+++ b/Tools/peg_generator/peg_extension/peg_extension.c
@@ -1,4 +1,6 @@
#include "pegen.h"
+#include "pycore_compile.h" // _PyAST_Compile()
+
PyObject *
_build_return_object(mod_ty module, int mode, PyObject *filename_ob, PyArena *arena)
@@ -6,7 +8,7 @@ _build_return_object(mod_ty module, int mode, PyObject *filename_ob, PyArena *ar
PyObject *result = NULL;
if (mode == 2) {
- result = (PyObject *)PyAST_CompileObject(module, filename_ob, NULL, -1, arena);
+ result = (PyObject *)_PyAST_Compile(module, filename_ob, NULL, -1, arena);
} else if (mode == 1) {
result = PyAST_mod2obj(module);
} else {