Jeremy Hylton | 3e0055f | 2005-10-20 19:59:25 +0000 | [diff] [blame] | 1 | #ifndef Py_AST_H |
| 2 | #define Py_AST_H |
| 3 | #ifdef __cplusplus |
| 4 | extern "C" { |
| 5 | #endif |
| 6 | |
Victor Stinner | 5f2df88 | 2018-11-12 00:56:19 +0100 | [diff] [blame] | 7 | #include "Python-ast.h" /* mod_ty */ |
| 8 | #include "node.h" /* node */ |
| 9 | |
Benjamin Peterson | 832bfe2 | 2011-08-09 16:15:04 -0500 | [diff] [blame] | 10 | PyAPI_FUNC(int) PyAST_Validate(mod_ty); |
Victor Stinner | 00676d1 | 2010-12-27 01:49:31 +0000 | [diff] [blame] | 11 | PyAPI_FUNC(mod_ty) PyAST_FromNode( |
| 12 | const node *n, |
| 13 | PyCompilerFlags *flags, |
| 14 | const char *filename, /* decoded from the filesystem encoding */ |
| 15 | PyArena *arena); |
Victor Stinner | 14e461d | 2013-08-26 22:28:21 +0200 | [diff] [blame] | 16 | PyAPI_FUNC(mod_ty) PyAST_FromNodeObject( |
| 17 | const node *n, |
| 18 | PyCompilerFlags *flags, |
| 19 | PyObject *filename, |
| 20 | PyArena *arena); |
Jeremy Hylton | 3e0055f | 2005-10-20 19:59:25 +0000 | [diff] [blame] | 21 | |
Guido van Rossum | 95e4d58 | 2018-01-26 08:20:18 -0800 | [diff] [blame] | 22 | #ifndef Py_LIMITED_API |
| 23 | |
| 24 | /* _PyAST_ExprAsUnicode is defined in ast_unparse.c */ |
Serhiy Storchaka | 64fddc4 | 2018-05-17 06:17:48 +0300 | [diff] [blame] | 25 | PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty); |
Guido van Rossum | 95e4d58 | 2018-01-26 08:20:18 -0800 | [diff] [blame] | 26 | |
Serhiy Storchaka | 143ce5c | 2018-05-30 10:56:16 +0300 | [diff] [blame] | 27 | /* Return the borrowed reference to the first literal string in the |
| 28 | sequence of statemnts or NULL if it doesn't start from a literal string. |
| 29 | Doesn't set exception. */ |
| 30 | PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_seq *); |
| 31 | |
Guido van Rossum | 95e4d58 | 2018-01-26 08:20:18 -0800 | [diff] [blame] | 32 | #endif /* !Py_LIMITED_API */ |
| 33 | |
Jeremy Hylton | 3e0055f | 2005-10-20 19:59:25 +0000 | [diff] [blame] | 34 | #ifdef __cplusplus |
| 35 | } |
| 36 | #endif |
| 37 | #endif /* !Py_AST_H */ |