typedef PyObject * string;
typedef PyObject * object;
-#ifndef __cplusplus
-typedef enum {false, true} bool;
-#endif
-
/* It would be nice if the code generated by asdl_c.py was completely
independent of Python, but it is a goal the requires too much work
at this stage. So, for example, I'll represent identifiers as
/*
- __version__ 53873.
+ __version__ 53956.
This module must be committed separately after each AST grammar change;
The __version__ number is set to the revision number of the commit
}
#define ast2obj_identifier ast2obj_object
#define ast2obj_string ast2obj_object
-static PyObject* ast2obj_bool(bool b)
-{
- return PyBool_FromLong(b);
-}
static PyObject* ast2obj_int(long b)
{
if (PyDict_SetItemString(d, "AST", (PyObject*)AST_type) < 0) return;
if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)
return;
- if (PyModule_AddStringConstant(m, "__version__", "53873") < 0)
+ if (PyModule_AddStringConstant(m, "__version__", "53956") < 0)
return;
if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return;
if (PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0)
int u_firstlineno; /* the first lineno of the block */
int u_lineno; /* the lineno for the current stmt */
- bool u_lineno_set; /* boolean to indicate whether instr
+ int u_lineno_set; /* boolean to indicate whether instr
has been generated with current lineno */
};
u->u_nfblocks = 0;
u->u_firstlineno = lineno;
u->u_lineno = 0;
- u->u_lineno_set = false;
+ u->u_lineno_set = 0;
u->u_consts = PyDict_New();
if (!u->u_consts) {
compiler_unit_free(u);
basicblock *b;
if (c->u->u_lineno_set)
return;
- c->u->u_lineno_set = true;
+ c->u->u_lineno_set = 1;
b = c->u->u_curblock;
b->b_instr[off].i_lineno = c->u->u_lineno;
}
/* XXX(nnorwitz): is there a better way to handle this?
for loops are special, we want to be able to trace them
each time around, so we need to set an extra line number. */
- c->u->u_lineno_set = false;
+ c->u->u_lineno_set = 0;
ADDOP_JREL(c, FOR_ITER, cleanup);
VISIT(c, expr, s->v.For.target);
VISIT_SEQ(c, stmt, s->v.For.body);
s->v.TryExcept.handlers, i);
if (!handler->type && i < n-1)
return compiler_error(c, "default 'except:' must be last");
- c->u->u_lineno_set = false;
+ c->u->u_lineno_set = 0;
c->u->u_lineno = handler->lineno;
except = compiler_new_block(c);
if (except == NULL)
/* Always assign a lineno to the next instruction for a stmt. */
c->u->u_lineno = s->lineno;
- c->u->u_lineno_set = false;
+ c->u->u_lineno_set = 0;
switch (s->kind) {
case FunctionDef_kind:
*/
if (e->lineno > c->u->u_lineno) {
c->u->u_lineno = e->lineno;
- c->u->u_lineno_set = false;
+ c->u->u_lineno_set = 0;
}
switch (e->kind) {
case BoolOp_kind: