Mercurial > cpython-lru_cache-weakref
diff Python/ast.c @ 37604:c732f66c913f legacy-trunk
Convert 0 to their respective enum types. Convert
void* to their respective _ty types. Fix signature of
ast_for_exprlist.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Tue, 11 Apr 2006 09:17:27 +0000 |
| parents | 2b2e9c388fbb |
| children | 5e72b0c74100 |
line wrap: on
line diff
--- a/Python/ast.c Tue Apr 11 09:08:02 2006 +0000 +++ b/Python/ast.c Tue Apr 11 09:17:27 2006 +0000 @@ -31,7 +31,7 @@ static expr_ty ast_for_expr(struct compiling *, const node *); static stmt_ty ast_for_stmt(struct compiling *, const node *); static asdl_seq *ast_for_suite(struct compiling *, const node *); -static asdl_seq *ast_for_exprlist(struct compiling *, const node *, int); +static asdl_seq *ast_for_exprlist(struct compiling *, const node *, expr_context_ty); static expr_ty ast_for_testlist(struct compiling *, const node *); static expr_ty ast_for_testlist_gexp(struct compiling *, const node *); @@ -316,7 +316,7 @@ case PERCENT: return Mod; default: - return 0; + return (operator_ty)0; } } @@ -424,7 +424,7 @@ int i; for (i = 0; i < asdl_seq_LEN(s); i++) { - if (!set_context(asdl_seq_GET(s, i), ctx, n)) + if (!set_context((expr_ty)asdl_seq_GET(s, i), ctx, n)) return 0; } } @@ -465,7 +465,7 @@ return Mult; default: PyErr_Format(PyExc_SystemError, "invalid augassign: %s", STR(n)); - return 0; + return (operator_ty)0; } } @@ -499,7 +499,7 @@ default: PyErr_Format(PyExc_SystemError, "invalid comp_op: %s", STR(n)); - return 0; + return (cmpop_ty)0; } } else if (NCH(n) == 2) { @@ -513,12 +513,12 @@ default: PyErr_Format(PyExc_SystemError, "invalid comp_op: %s %s", STR(CHILD(n, 0)), STR(CHILD(n, 1))); - return 0; + return (cmpop_ty)0; } } PyErr_Format(PyExc_SystemError, "invalid comp_op: has %d children", NCH(n)); - return 0; + return (cmpop_ty)0; } static asdl_seq * @@ -985,7 +985,7 @@ return NULL; if (asdl_seq_LEN(t) == 1) - lc = comprehension(asdl_seq_GET(t, 0), expression, NULL, + lc = comprehension((expr_ty)asdl_seq_GET(t, 0), expression, NULL, c->c_arena); else lc = comprehension(Tuple(t, Store, LINENO(ch), ch->n_col_offset, @@ -1131,7 +1131,7 @@ return NULL; if (asdl_seq_LEN(t) == 1) - ge = comprehension(asdl_seq_GET(t, 0), expression, + ge = comprehension((expr_ty)asdl_seq_GET(t, 0), expression, NULL, c->c_arena); else ge = comprehension(Tuple(t, Store, LINENO(ch), ch->n_col_offset, @@ -2002,7 +2002,7 @@ } static asdl_seq * -ast_for_exprlist(struct compiling *c, const node *n, int context) +ast_for_exprlist(struct compiling *c, const node *n, expr_context_ty context) { asdl_seq *seq; int i; @@ -2626,7 +2626,7 @@ if (!_target) return NULL; if (asdl_seq_LEN(_target) == 1) - target = asdl_seq_GET(_target, 0); + target = (expr_ty)asdl_seq_GET(_target, 0); else target = Tuple(_target, Store, LINENO(n), n->n_col_offset, c->c_arena);
