File tree Expand file tree Collapse file tree 8 files changed +37
-21
lines changed
Expand file tree Collapse file tree 8 files changed +37
-21
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,6 @@ extern "C" {
99
1010PyAPI_FUNC (int ) PyAST_Validate (mod_ty );
1111
12- /* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
13- PyAPI_FUNC (PyObject * ) _PyAST_ExprAsUnicode (expr_ty );
14-
15- /* Return the borrowed reference to the first literal string in the
16- sequence of statements or NULL if it doesn't start from a literal string.
17- Doesn't set exception. */
18- PyAPI_FUNC (PyObject * ) _PyAST_GetDocString (asdl_stmt_seq * );
19-
2012#ifdef __cplusplus
2113}
2214#endif
Original file line number Diff line number Diff line change 1+ #ifndef Py_INTERNAL_AST_H
2+ #define Py_INTERNAL_AST_H
3+ #ifdef __cplusplus
4+ extern "C" {
5+ #endif
6+
7+ #ifndef Py_BUILD_CORE
8+ # error "this header requires Py_BUILD_CORE define"
9+ #endif
10+
11+ #include "Python-ast.h" // expr_ty
12+
13+ /* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
14+ extern PyObject * _PyAST_ExprAsUnicode (expr_ty );
15+
16+ /* Return the borrowed reference to the first literal string in the
17+ sequence of statements or NULL if it doesn't start from a literal string.
18+ Doesn't set exception. */
19+ extern PyObject * _PyAST_GetDocString (asdl_stmt_seq * );
20+
21+ #ifdef __cplusplus
22+ }
23+ #endif
24+ #endif /* !Py_INTERNAL_AST_H */
25+
Original file line number Diff line number Diff line change @@ -1135,6 +1135,7 @@ PYTHON_HEADERS= \
11351135 \
11361136 $(srcdir)/Include/internal/pycore_abstract.h \
11371137 $(srcdir)/Include/internal/pycore_accu.h \
1138+ $(srcdir)/Include/internal/pycore_ast.h \
11381139 $(srcdir)/Include/internal/pycore_ast_state.h \
11391140 $(srcdir)/Include/internal/pycore_atomic.h \
11401141 $(srcdir)/Include/internal/pycore_atomic_funcs.h \
Original file line number Diff line number Diff line change 175175 <ClInclude Include =" ..\Include\import.h" />
176176 <ClInclude Include =" ..\Include\internal\pycore_abstract.h" />
177177 <ClInclude Include =" ..\Include\internal\pycore_accu.h" />
178+ <ClInclude Include =" ..\Include\internal\pycore_ast.h" />
178179 <ClInclude Include =" ..\Include\internal\pycore_ast_state.h" />
179180 <ClInclude Include =" ..\Include\internal\pycore_atomic.h" />
180181 <ClInclude Include =" ..\Include\internal\pycore_atomic_funcs.h" />
Original file line number Diff line number Diff line change 486486 <ClInclude Include =" ..\Include\internal\pycore_accu.h" >
487487 <Filter >Include\internal</Filter >
488488 </ClInclude >
489+ <ClInclude Include =" ..\Include\internal\pycore_ast.h" >
490+ <Filter >Include\internal</Filter >
491+ </ClInclude >
489492 <ClInclude Include =" ..\Include\internal\pycore_ast_state.h" >
490493 <Filter >Include\internal</Filter >
491494 </ClInclude >
Original file line number Diff line number Diff line change 11/* AST Optimizer */
22#include "Python.h"
3- #include "Python-ast.h"
4- #include "ast.h"
3+ #include "pycore_ast.h" // _PyAST_GetDocString()
54
65
76static int
Original file line number Diff line number Diff line change 2222 */
2323
2424#include "Python.h"
25+ #include "pycore_ast.h" // _PyAST_GetDocString()
2526#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
2627#include "pycore_long.h" // _PyLong_GetZero()
2728
28- #include "Python-ast.h"
29- #include "ast.h"
30- #include "code.h"
31- #include "symtable.h"
29+ #include "symtable.h" // struct symtable
3230#define NEED_OPCODE_JUMP_TABLES
33- #include "opcode.h"
34- #include "wordcode_helpers.h"
31+ #include "opcode.h" // EXTENDED_ARG
32+ #include "wordcode_helpers.h" // instrsize()
33+
3534
3635#define DEFAULT_BLOCK_SIZE 16
3736#define DEFAULT_BLOCKS 8
Original file line number Diff line number Diff line change 11#include "Python.h"
2- #include "Python-ast.h"
3- #include "token.h"
4- #include "code.h"
5- #include "symtable.h"
6- #include "ast.h"
2+ #include "pycore_ast.h" // _PyAST_GetDocString()
73
84#define UNDEFINED_FUTURE_FEATURE "future feature %.100s is not defined"
95#define ERR_LATE_FUTURE \
You can’t perform that action at this time.
0 commit comments