blob: 029cb17ab2d4813540b06ed58121dcd26bbc31e5 [file] [log] [blame]
Jeremy Hylton3e0055f2005-10-20 19:59:25 +00001#ifndef Py_CODE_H
2#include "code.h"
3#endif
Guido van Rossum3f5da241990-12-20 15:06:42 +00004
Fred Drakeea9cb5a2000-07-09 00:20:36 +00005#ifndef Py_COMPILE_H
6#define Py_COMPILE_H
7#ifdef __cplusplus
8extern "C" {
9#endif
10
Guido van Rossum3f5da241990-12-20 15:06:42 +000011/* Public interface */
Guido van Rossume543a941991-04-03 19:00:55 +000012struct _node; /* Declare the existence of this type */
Martin v. Löwis95292d62002-12-11 14:04:59 +000013PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *);
Guido van Rossuma3309961993-07-28 09:05:47 +000014
Jeremy Hylton4db62b12001-02-27 19:07:02 +000015/* Future feature support */
16
17typedef struct {
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000018 int ff_features; /* flags set by future statements */
19 int ff_lineno; /* line number of last future statement */
Jeremy Hylton4db62b12001-02-27 19:07:02 +000020} PyFutureFeatures;
21
Jeremy Hylton4db62b12001-02-27 19:07:02 +000022#define FUTURE_NESTED_SCOPES "nested_scopes"
Guido van Rossumb09f7ed2001-07-15 21:08:29 +000023#define FUTURE_GENERATORS "generators"
Guido van Rossum4668b002001-08-08 05:00:18 +000024#define FUTURE_DIVISION "division"
25
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000026struct _mod; /* Declare the existence of this type */
Neal Norwitz38eb50b2005-10-23 19:06:02 +000027PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *,
Neal Norwitzadb69fc2005-12-17 20:54:49 +000028 PyCompilerFlags *, PyArena *);
Neal Norwitz38eb50b2005-10-23 19:06:02 +000029PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000030
31#define ERR_LATE_FUTURE \
32"from __future__ imports must occur at the beginning of the file"
33
Guido van Rossuma3309961993-07-28 09:05:47 +000034#ifdef __cplusplus
35}
36#endif
37#endif /* !Py_COMPILE_H */