Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-19 09:50:40

0001 #ifndef Py_CPYTHON_COMPILE_H
0002 #  error "this header file must not be included directly"
0003 #endif
0004 
0005 /* Public interface */
0006 #define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \
0007                    CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \
0008                    CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \
0009                    CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS)
0010 #define PyCF_MASK_OBSOLETE (CO_NESTED)
0011 
0012 /* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique.
0013    PyCF_ constants can use bits from 0x0100 to 0x10000.
0014    CO_FUTURE_ constants use bits starting at 0x20000. */
0015 #define PyCF_SOURCE_IS_UTF8  0x0100
0016 #define PyCF_DONT_IMPLY_DEDENT 0x0200
0017 #define PyCF_ONLY_AST 0x0400
0018 #define PyCF_IGNORE_COOKIE 0x0800
0019 #define PyCF_TYPE_COMMENTS 0x1000
0020 #define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000
0021 #define PyCF_ALLOW_INCOMPLETE_INPUT 0x4000
0022 #define PyCF_OPTIMIZED_AST (0x8000 | PyCF_ONLY_AST)
0023 #define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \
0024                            PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT | \
0025                            PyCF_ALLOW_INCOMPLETE_INPUT | PyCF_OPTIMIZED_AST)
0026 
0027 typedef struct {
0028     int cf_flags;  /* bitmask of CO_xxx flags relevant to future */
0029     int cf_feature_version;  /* minor Python version (PyCF_ONLY_AST) */
0030 } PyCompilerFlags;
0031 
0032 #define _PyCompilerFlags_INIT \
0033     (PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION}
0034 
0035 /* Future feature support */
0036 
0037 #define FUTURE_NESTED_SCOPES "nested_scopes"
0038 #define FUTURE_GENERATORS "generators"
0039 #define FUTURE_DIVISION "division"
0040 #define FUTURE_ABSOLUTE_IMPORT "absolute_import"
0041 #define FUTURE_WITH_STATEMENT "with_statement"
0042 #define FUTURE_PRINT_FUNCTION "print_function"
0043 #define FUTURE_UNICODE_LITERALS "unicode_literals"
0044 #define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL"
0045 #define FUTURE_GENERATOR_STOP "generator_stop"
0046 #define FUTURE_ANNOTATIONS "annotations"
0047 
0048 #define PY_INVALID_STACK_EFFECT INT_MAX
0049 PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg);
0050 PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump);