compile.h 985 Bytes
Newer Older
Jeremy Hylton's avatar
Jeremy Hylton committed
1 2 3
#ifndef Py_CODE_H
#include "code.h"
#endif
Guido van Rossum's avatar
Guido van Rossum committed
4

5 6 7 8 9 10
#ifndef Py_COMPILE_H
#define Py_COMPILE_H
#ifdef __cplusplus
extern "C" {
#endif

Guido van Rossum's avatar
Guido van Rossum committed
11
/* Public interface */
12
struct _node; /* Declare the existence of this type */
13
PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *);
14

15 16 17
/* Future feature support */

typedef struct {
Jeremy Hylton's avatar
Jeremy Hylton committed
18 19
    int ff_features;      /* flags set by future statements */
    int ff_lineno;        /* line number of last future statement */
20 21 22
} PyFutureFeatures;

#define FUTURE_NESTED_SCOPES "nested_scopes"
23
#define FUTURE_GENERATORS "generators"
24 25
#define FUTURE_DIVISION "division"

Jeremy Hylton's avatar
Jeremy Hylton committed
26
struct _mod; /* Declare the existence of this type */
27
PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *,
28
					PyCompilerFlags *, PyArena *);
29
PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
Jeremy Hylton's avatar
Jeremy Hylton committed
30 31 32 33

#define ERR_LATE_FUTURE \
"from __future__ imports must occur at the beginning of the file"

34 35 36 37
#ifdef __cplusplus
}
#endif
#endif /* !Py_COMPILE_H */