int ste_col_offset; /* offset of first line of block */
int ste_opt_lineno; /* lineno of last exec or import * */
int ste_opt_col_offset; /* offset of last exec or import * */
- int ste_tmpname; /* counter for listcomp temp vars */
struct symtable *ste_table;
} PySTEntryObject;
ste->ste_varkeywords = 0;
ste->ste_opt_lineno = 0;
ste->ste_opt_col_offset = 0;
- ste->ste_tmpname = 0;
ste->ste_lineno = lineno;
ste->ste_col_offset = col_offset;
} \
}
-static int
-symtable_new_tmpname(struct symtable *st)
-{
- char tmpname[256];
- identifier tmp;
-
- PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]",
- ++st->st_cur->ste_tmpname);
- tmp = PyUnicode_InternFromString(tmpname);
- if (!tmp)
- return 0;
- if (!symtable_add_def(st, tmp, DEF_LOCAL))
- return 0;
- Py_DECREF(tmp);
- return 1;
-}
-
-
static int
symtable_record_directive(struct symtable *st, identifier name, stmt_ty s)
{
expr_ty elt, expr_ty value)
{
int is_generator = (e->kind == GeneratorExp_kind);
- int needs_tmp = !is_generator;
comprehension_ty outermost = ((comprehension_ty)
asdl_seq_GET(generators, 0));
/* Outermost iterator is evaluated in current scope */
symtable_exit_block(st, (void *)e);
return 0;
}
- /* Allocate temporary name if needed */
- if (needs_tmp && !symtable_new_tmpname(st)) {
- symtable_exit_block(st, (void *)e);
- return 0;
- }
VISIT(st, expr, outermost->target);
VISIT_SEQ(st, expr, outermost->ifs);
VISIT_SEQ_TAIL(st, comprehension, generators, 1);