@@ -13,6 +13,13 @@ struct _mod; // Type defined in pycore_ast.h
13
13
typedef enum _block_type { FunctionBlock , ClassBlock , ModuleBlock , AnnotationBlock }
14
14
_Py_block_ty ;
15
15
16
+ typedef enum _comprehension_type {
17
+ NoComprehension = 0 ,
18
+ ListComprehension = 1 ,
19
+ DictComprehension = 2 ,
20
+ SetComprehension = 3 ,
21
+ GeneratorExpression = 4 } _Py_comprehension_ty ;
22
+
16
23
struct _symtable_entry ;
17
24
18
25
struct symtable {
@@ -42,14 +49,14 @@ typedef struct _symtable_entry {
42
49
PyObject * ste_varnames ; /* list of function parameters */
43
50
PyObject * ste_children ; /* list of child blocks */
44
51
PyObject * ste_directives ;/* locations of global and nonlocal statements */
45
- _Py_block_ty ste_type ; /* module, class, or function */
52
+ _Py_block_ty ste_type ; /* module, class or function */
46
53
int ste_nested ; /* true if block is nested */
47
54
unsigned ste_free : 1 ; /* true if block has free variables */
48
55
unsigned ste_child_free : 1 ; /* true if a child block has free vars,
49
56
including free refs to globals */
50
57
unsigned ste_generator : 1 ; /* true if namespace is a generator */
51
58
unsigned ste_coroutine : 1 ; /* true if namespace is a coroutine */
52
- unsigned ste_comprehension : 1 ; /* true if namespace is a list comprehension */
59
+ _Py_comprehension_ty ste_comprehension ; /* Kind of comprehension (if any) */
53
60
unsigned ste_varargs : 1 ; /* true if block has varargs */
54
61
unsigned ste_varkeywords : 1 ; /* true if block has varkeywords */
55
62
unsigned ste_returns_value : 1 ; /* true if namespace uses return with
0 commit comments