compile.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef Py_COMPILE_H
  2. #define Py_COMPILE_H
  3. #include "code.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /* Public interface */
  8. struct _node; /* Declare the existence of this type */
  9. PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *);
  10. /* Future feature support */
  11. typedef struct {
  12. int ff_features; /* flags set by future statements */
  13. int ff_lineno; /* line number of last future statement */
  14. } PyFutureFeatures;
  15. #define FUTURE_NESTED_SCOPES "nested_scopes"
  16. #define FUTURE_GENERATORS "generators"
  17. #define FUTURE_DIVISION "division"
  18. #define FUTURE_ABSOLUTE_IMPORT "absolute_import"
  19. #define FUTURE_WITH_STATEMENT "with_statement"
  20. #define FUTURE_PRINT_FUNCTION "print_function"
  21. #define FUTURE_UNICODE_LITERALS "unicode_literals"
  22. struct _mod; /* Declare the existence of this type */
  23. PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *,
  24. PyCompilerFlags *, PyArena *);
  25. PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
  26. #ifdef __cplusplus
  27. }
  28. #endif
  29. #endif /* !Py_COMPILE_H */