File: pycore_compile.h

package info (click to toggle)
python3.11 3.11.2-6%2Bdeb12u6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 113,292 kB
  • sloc: python: 660,794; ansic: 553,003; xml: 31,209; sh: 5,453; cpp: 3,978; makefile: 1,987; asm: 1,486; objc: 761; lisp: 502; javascript: 118; csh: 12
file content (44 lines) | stat: -rw-r--r-- 1,045 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef Py_INTERNAL_COMPILE_H
#define Py_INTERNAL_COMPILE_H
#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_BUILD_CORE
#  error "this header requires Py_BUILD_CORE define"
#endif

struct _arena;   // Type defined in pycore_pyarena.h
struct _mod;     // Type defined in pycore_ast.h

// Export the symbol for test_peg_generator (built as a library)
PyAPI_FUNC(PyCodeObject*) _PyAST_Compile(
    struct _mod *mod,
    PyObject *filename,
    PyCompilerFlags *flags,
    int optimize,
    struct _arena *arena);
extern PyFutureFeatures* _PyFuture_FromAST(
    struct _mod * mod,
    PyObject *filename
    );

extern PyObject* _Py_Mangle(PyObject *p, PyObject *name);

typedef struct {
    int optimize;
    int ff_features;

    int recursion_depth;            /* current recursion depth */
    int recursion_limit;            /* recursion limit */
} _PyASTOptimizeState;

extern int _PyAST_Optimize(
    struct _mod *,
    struct _arena *arena,
    _PyASTOptimizeState *state);

#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_COMPILE_H */