summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
Diffstat (limited to 'Include')
-rw-r--r--Include/ast.h8
-rw-r--r--Include/internal/pycore_ast.h25
2 files changed, 25 insertions, 8 deletions
diff --git a/Include/ast.h b/Include/ast.h
index 434ee18..2f19b1a 100644
--- a/Include/ast.h
+++ b/Include/ast.h
@@ -9,14 +9,6 @@ extern "C" {
PyAPI_FUNC(int) PyAST_Validate(mod_ty);
-/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
-PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty);
-
-/* Return the borrowed reference to the first literal string in the
- sequence of statements or NULL if it doesn't start from a literal string.
- Doesn't set exception. */
-PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_stmt_seq *);
-
#ifdef __cplusplus
}
#endif
diff --git a/Include/internal/pycore_ast.h b/Include/internal/pycore_ast.h
new file mode 100644
index 0000000..38c9212
--- /dev/null
+++ b/Include/internal/pycore_ast.h
@@ -0,0 +1,25 @@
+#ifndef Py_INTERNAL_AST_H
+#define Py_INTERNAL_AST_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
+#include "Python-ast.h" // expr_ty
+
+/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
+extern PyObject* _PyAST_ExprAsUnicode(expr_ty);
+
+/* Return the borrowed reference to the first literal string in the
+ sequence of statements or NULL if it doesn't start from a literal string.
+ Doesn't set exception. */
+extern PyObject* _PyAST_GetDocString(asdl_stmt_seq *);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !Py_INTERNAL_AST_H */
+