@@ -13,6 +13,13 @@ struct _mod; // Type defined in pycore_ast.h
1313typedef enum _block_type { FunctionBlock , ClassBlock , ModuleBlock , AnnotationBlock }
1414 _Py_block_ty ;
1515
16+ typedef enum _comprehension_type {
17+ NoComprehension = 0 ,
18+ ListComprehension = 1 ,
19+ DictComprehension = 2 ,
20+ SetComprehension = 3 ,
21+ GeneratorExpression = 4 } _Py_comprehension_ty ;
22+
1623struct _symtable_entry ;
1724
1825struct symtable {
@@ -42,14 +49,14 @@ typedef struct _symtable_entry {
4249 PyObject * ste_varnames ; /* list of function parameters */
4350 PyObject * ste_children ; /* list of child blocks */
4451 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 */
4653 int ste_nested ; /* true if block is nested */
4754 unsigned ste_free : 1 ; /* true if block has free variables */
4855 unsigned ste_child_free : 1 ; /* true if a child block has free vars,
4956 including free refs to globals */
5057 unsigned ste_generator : 1 ; /* true if namespace is a generator */
5158 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) */
5360 unsigned ste_varargs : 1 ; /* true if block has varargs */
5461 unsigned ste_varkeywords : 1 ; /* true if block has varkeywords */
5562 unsigned ste_returns_value : 1 ; /* true if namespace uses return with
0 commit comments