You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.6 KiB

  1. #ifndef Py_COMPILE_H
  2. #define Py_COMPILE_H
  3. #ifndef Py_LIMITED_API
  4. #include "code.h"
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. /* Public interface */
  9. struct _node; /* Declare the existence of this type */
  10. PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *);
  11. /* Future feature support */
  12. typedef struct {
  13. int ff_features; /* flags set by future statements */
  14. int ff_lineno; /* line number of last future statement */
  15. } PyFutureFeatures;
  16. #define FUTURE_NESTED_SCOPES "nested_scopes"
  17. #define FUTURE_GENERATORS "generators"
  18. #define FUTURE_DIVISION "division"
  19. #define FUTURE_ABSOLUTE_IMPORT "absolute_import"
  20. #define FUTURE_WITH_STATEMENT "with_statement"
  21. #define FUTURE_PRINT_FUNCTION "print_function"
  22. #define FUTURE_UNICODE_LITERALS "unicode_literals"
  23. #define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL"
  24. struct _mod; /* Declare the existence of this type */
  25. #define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar)
  26. PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx(
  27. struct _mod *mod,
  28. const char *filename, /* decoded from the filesystem encoding */
  29. PyCompilerFlags *flags,
  30. int optimize,
  31. PyArena *arena);
  32. PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
  33. /* _Py_Mangle is defined in compile.c */
  34. PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
  35. #ifdef __cplusplus
  36. }
  37. #endif
  38. #endif /* !Py_LIMITED_API */
  39. /* These definitions must match corresponding definitions in graminit.h.
  40. There's code in compile.c that checks that they are the same. */
  41. #define Py_single_input 256
  42. #define Py_file_input 257
  43. #define Py_eval_input 258
  44. #endif /* !Py_COMPILE_H */