Lines Matching refs:ste
50 PySTEntryObject *ste = NULL; in ste_new() local
56 ste = PyObject_New(PySTEntryObject, &PySTEntry_Type); in ste_new()
57 if (ste == NULL) { in ste_new()
61 ste->ste_table = st; in ste_new()
62 ste->ste_id = k; /* ste owns reference to k */ in ste_new()
65 ste->ste_name = name; in ste_new()
67 ste->ste_symbols = NULL; in ste_new()
68 ste->ste_varnames = NULL; in ste_new()
69 ste->ste_children = NULL; in ste_new()
71 ste->ste_directives = NULL; in ste_new()
73 ste->ste_type = block; in ste_new()
74 ste->ste_nested = 0; in ste_new()
75 ste->ste_free = 0; in ste_new()
76 ste->ste_varargs = 0; in ste_new()
77 ste->ste_varkeywords = 0; in ste_new()
78 ste->ste_opt_lineno = 0; in ste_new()
79 ste->ste_opt_col_offset = 0; in ste_new()
80 ste->ste_lineno = lineno; in ste_new()
81 ste->ste_col_offset = col_offset; in ste_new()
86 ste->ste_nested = 1; in ste_new()
87 ste->ste_child_free = 0; in ste_new()
88 ste->ste_generator = 0; in ste_new()
89 ste->ste_coroutine = 0; in ste_new()
90 ste->ste_comprehension = 0; in ste_new()
91 ste->ste_returns_value = 0; in ste_new()
92 ste->ste_needs_class_closure = 0; in ste_new()
93 ste->ste_comp_iter_target = 0; in ste_new()
94 ste->ste_comp_iter_expr = 0; in ste_new()
96 ste->ste_symbols = PyDict_New(); in ste_new()
97 ste->ste_varnames = PyList_New(0); in ste_new()
98 ste->ste_children = PyList_New(0); in ste_new()
99 if (ste->ste_symbols == NULL in ste_new()
100 || ste->ste_varnames == NULL in ste_new()
101 || ste->ste_children == NULL) in ste_new()
104 if (PyDict_SetItem(st->st_blocks, ste->ste_id, (PyObject *)ste) < 0) in ste_new()
107 return ste; in ste_new()
109 Py_XDECREF(ste); in ste_new()
114 ste_repr(PySTEntryObject *ste) in ste_repr() argument
117 ste->ste_name, in ste_repr()
118 PyLong_AS_LONG(ste->ste_id), ste->ste_lineno); in ste_repr()
122 ste_dealloc(PySTEntryObject *ste) in ste_dealloc() argument
124 ste->ste_table = NULL; in ste_dealloc()
125 Py_XDECREF(ste->ste_id); in ste_dealloc()
126 Py_XDECREF(ste->ste_name); in ste_dealloc()
127 Py_XDECREF(ste->ste_symbols); in ste_dealloc()
128 Py_XDECREF(ste->ste_varnames); in ste_dealloc()
129 Py_XDECREF(ste->ste_children); in ste_dealloc()
130 Py_XDECREF(ste->ste_directives); in ste_dealloc()
131 PyObject_Del(ste); in ste_dealloc()
393 _PyST_GetSymbol(PySTEntryObject *ste, PyObject *name) in _PyST_GetSymbol() argument
395 PyObject *v = PyDict_GetItem(ste->ste_symbols, name); in _PyST_GetSymbol()
403 PyST_GetScope(PySTEntryObject *ste, PyObject *name) in PyST_GetScope() argument
405 long symbol = _PyST_GetSymbol(ste, name); in PyST_GetScope()
410 error_at_directive(PySTEntryObject *ste, PyObject *name) in error_at_directive() argument
414 assert(ste->ste_directives); in error_at_directive()
415 for (i = 0; i < PyList_GET_SIZE(ste->ste_directives); i++) { in error_at_directive()
416 data = PyList_GET_ITEM(ste->ste_directives, i); in error_at_directive()
420 PyErr_SyntaxLocationObject(ste->ste_table->st_filename, in error_at_directive()
497 analyze_name(PySTEntryObject *ste, PyObject *scopes, PyObject *name, long flags, in analyze_name() argument
506 return error_at_directive(ste, name); in analyze_name()
519 return error_at_directive(ste, name); in analyze_name()
526 return error_at_directive(ste, name); in analyze_name()
529 ste->ste_free = 1; in analyze_name()
547 ste->ste_free = 1; in analyze_name()
557 if (ste->ste_nested) in analyze_name()
558 ste->ste_free = 1; in analyze_name()
607 drop_class_free(PySTEntryObject *ste, PyObject *free) in drop_class_free() argument
616 ste->ste_needs_class_closure = 1; in drop_class_free()
737 analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free, in analyze_block() argument
779 if (ste->ste_type == ClassBlock) { in analyze_block()
794 while (PyDict_Next(ste->ste_symbols, &pos, &name, &v)) { in analyze_block()
796 if (!analyze_name(ste, scopes, name, flags, in analyze_block()
802 if (ste->ste_type != ClassBlock) { in analyze_block()
804 if (ste->ste_type == FunctionBlock) { in analyze_block()
840 for (i = 0; i < PyList_GET_SIZE(ste->ste_children); ++i) { in analyze_block()
841 PyObject *c = PyList_GET_ITEM(ste->ste_children, i); in analyze_block()
850 ste->ste_child_free = 1; in analyze_block()
859 if (ste->ste_type == FunctionBlock && !analyze_cells(scopes, newfree)) in analyze_block()
861 else if (ste->ste_type == ClassBlock && !drop_class_free(ste, newfree)) in analyze_block()
864 if (!update_symbols(ste->ste_symbols, scopes, bound, newfree, in analyze_block()
865 ste->ste_type == ClassBlock)) in analyze_block()
971 PySTEntryObject *prev = NULL, *ste; in symtable_enter_block() local
973 ste = ste_new(st, name, block, ast, lineno, col_offset); in symtable_enter_block()
974 if (ste == NULL) in symtable_enter_block()
976 if (PyList_Append(st->st_stack, (PyObject *)ste) < 0) { in symtable_enter_block()
977 Py_DECREF(ste); in symtable_enter_block()
986 ste->ste_comp_iter_expr = prev->ste_comp_iter_expr; in symtable_enter_block()
989 Py_DECREF(ste); in symtable_enter_block()
990 st->st_cur = ste; in symtable_enter_block()
994 if (PyList_Append(prev->ste_children, (PyObject *)ste) < 0) { in symtable_enter_block()
1013 symtable_add_def_helper(struct symtable *st, PyObject *name, int flag, struct _symtable_entry *ste) in symtable_add_def_helper() argument
1023 dict = ste->ste_symbols; in symtable_add_def_helper()
1030 ste->ste_lineno, in symtable_add_def_helper()
1031 ste->ste_col_offset + 1); in symtable_add_def_helper()
1042 if (ste->ste_comp_iter_target) { in symtable_add_def_helper()
1052 ste->ste_lineno, in symtable_add_def_helper()
1053 ste->ste_col_offset + 1); in symtable_add_def_helper()
1068 if (PyList_Append(ste->ste_varnames, mangled) < 0) in symtable_add_def_helper()
1442 struct _symtable_entry *ste; in symtable_extend_namedexpr_scope() local
1448 ste = (struct _symtable_entry *) PyList_GET_ITEM(st->st_stack, i); in symtable_extend_namedexpr_scope()
1453 if (ste->ste_comprehension) { in symtable_extend_namedexpr_scope()
1454 long target_in_scope = _PyST_GetSymbol(ste, target_name); in symtable_extend_namedexpr_scope()
1466 if (ste->ste_type == FunctionBlock) { in symtable_extend_namedexpr_scope()
1467 long target_in_scope = _PyST_GetSymbol(ste, target_name); in symtable_extend_namedexpr_scope()
1478 return symtable_add_def_helper(st, target_name, DEF_LOCAL, ste); in symtable_extend_namedexpr_scope()
1481 if (ste->ste_type == ModuleBlock) { in symtable_extend_namedexpr_scope()
1487 return symtable_add_def_helper(st, target_name, DEF_GLOBAL, ste); in symtable_extend_namedexpr_scope()
1490 if (ste->ste_type == ClassBlock) { in symtable_extend_namedexpr_scope()