PyObject *st_global; /* borrowed ref to MODULE in st_symbols */
int st_nblocks; /* number of blocks */
PyObject *st_private; /* name of current class or NULL */
- int st_tmpname; /* temporary name counter */
PyFutureFeatures *st_future; /* module's future features */
};
an argument */
int ste_lineno; /* first line of block */
int ste_opt_lineno; /* lineno of last exec or import * */
- int ste_tmpname; /* counter for listcomp temp vars */
struct symtable *ste_table;
} PySTEntryObject;
members, you can reach all early allocated blocks. */
basicblock *u_blocks;
basicblock *u_curblock; /* pointer to current block */
- int u_tmpname; /* temporary variables for list comps */
int u_nfblocks;
struct fblockinfo u_fblock[CO_MAXBLOCKS];
}
u->u_blocks = NULL;
- u->u_tmpname = 0;
u->u_nfblocks = 0;
u->u_firstlineno = lineno;
u->u_lineno = 0;
goto fail;
ste->ste_table = st;
ste->ste_id = k;
- ste->ste_tmpname = 0;
ste->ste_name = name;
Py_INCREF(name);
ste->ste_varargs = 0;
ste->ste_varkeywords = 0;
ste->ste_opt_lineno = 0;
- ste->ste_tmpname = 0;
ste->ste_lineno = lineno;
if (st->st_cur != NULL &&
if ((st->st_symbols = PyDict_New()) == NULL)
goto fail;
st->st_cur = NULL;
- st->st_tmpname = 0;
st->st_private = NULL;
return st;
fail:
} \
}
-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 = PyString_InternFromString(tmpname);
- if (!tmp)
- return 0;
- if (!symtable_add_def(st, tmp, DEF_LOCAL))
- return 0;
- Py_DECREF(tmp);
- return 1;
-}
-
static int
symtable_visit_stmt(struct symtable *st, stmt_ty s)
{
/* nothing to do here */
break;
case With_kind:
- if (!symtable_new_tmpname(st))
- return 0;
VISIT(st, expr, s->v.With.context_expr);
if (s->v.With.optional_vars) {
- if (!symtable_new_tmpname(st))
- return 0;
VISIT(st, expr, s->v.With.optional_vars);
}
VISIT_SEQ(st, stmt, s->v.With.body);
VISIT_SEQ(st, expr, e->v.Dict.values);
break;
case ListComp_kind:
- if (!symtable_new_tmpname(st))
- return 0;
VISIT(st, expr, e->v.ListComp.elt);
VISIT_SEQ(st, comprehension, e->v.ListComp.generators);
break;