Mercurial > cpython-lru_cache-weakref
diff Python/ast.c @ 39779:b8fbd322760a legacy-trunk
with and as are now keywords. There are some generated files I can't recreate.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Wed, 06 Sep 2006 06:28:06 +0000 |
| parents | 3d968b5fcaf9 |
| children | b8cb7201379c |
line wrap: on
line diff
--- a/Python/ast.c Wed Sep 06 06:09:31 2006 +0000 +++ b/Python/ast.c Wed Sep 06 06:28:06 2006 +0000 @@ -2190,10 +2190,6 @@ case import_as_name: str = NULL; if (NCH(n) == 3) { - if (strcmp(STR(CHILD(n, 1)), "as") != 0) { - ast_error(n, "must use 'as' in import"); - return NULL; - } str = NEW_IDENTIFIER(CHILD(n, 2)); } return alias(NEW_IDENTIFIER(CHILD(n, 0)), str, c->c_arena); @@ -2206,10 +2202,6 @@ alias_ty a = alias_for_import_name(c, CHILD(n, 0)); if (!a) return NULL; - if (strcmp(STR(CHILD(n, 1)), "as") != 0) { - ast_error(n, "must use 'as' in import"); - return NULL; - } assert(!a->asname); a->asname = NEW_IDENTIFIER(CHILD(n, 2)); return a; @@ -2848,10 +2840,6 @@ ast_for_with_var(struct compiling *c, const node *n) { REQ(n, with_var); - if (strcmp(STR(CHILD(n, 0)), "as") != 0) { - ast_error(n, "expected \"with [expr] as [var]\""); - return NULL; - } return ast_for_expr(c, CHILD(n, 1)); }
