blob: a8c52af786b1472200b9b3651462f8101f2d8e0a [file] [log] [blame]
Olivier Deprezf4ef2d02021-04-20 13:36:24 +02001#ifndef Py_LIMITED_API
2#ifndef Py_AST_H
3#define Py_AST_H
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include "Python-ast.h" /* mod_ty */
9#include "node.h" /* node */
10
11PyAPI_FUNC(int) PyAST_Validate(mod_ty);
12PyAPI_FUNC(mod_ty) PyAST_FromNode(
13 const node *n,
14 PyCompilerFlags *flags,
15 const char *filename, /* decoded from the filesystem encoding */
16 PyArena *arena);
17PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
18 const node *n,
19 PyCompilerFlags *flags,
20 PyObject *filename,
21 PyArena *arena);
22
23/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
24PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty);
25
26/* Return the borrowed reference to the first literal string in the
27 sequence of statements or NULL if it doesn't start from a literal string.
28 Doesn't set exception. */
29PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_seq *);
30
31#ifdef __cplusplus
32}
33#endif
34#endif /* !Py_AST_H */
35#endif /* !Py_LIMITED_API */