Mercurial > cpython-lru_cache-weakref
diff Python/ast.c @ 39783:7a0ad110e91e
Patch #1550786: ellipsis literal.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Wed, 06 Sep 2006 07:06:08 +0000 |
| parents | c94f37054f19 |
| children | 1cce0526d9b0 |
line wrap: on
line diff
--- a/Python/ast.c Wed Sep 06 06:51:57 2006 +0000 +++ b/Python/ast.c Wed Sep 06 07:06:08 2006 +0000 @@ -399,6 +399,9 @@ case Str_kind: expr_name = "literal"; break; + case Ellipsis_kind: + expr_name = "Ellipsis"; + break; case Compare_kind: expr_name = "comparison"; break; @@ -1213,6 +1216,9 @@ PyArena_AddPyObject(c->c_arena, pynum); return Num(pynum, LINENO(n), n->n_col_offset, c->c_arena); } + case DOT: + /* Ellipsis */ + return Ellipsis(LINENO(n), n->n_col_offset, c->c_arena); case LPAR: /* some parenthesized expressions */ ch = CHILD(n, 1); @@ -1308,13 +1314,10 @@ REQ(n, subscript); /* - subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] + subscript: test | [test] ':' [test] [sliceop] sliceop: ':' [test] */ ch = CHILD(n, 0); - if (TYPE(ch) == DOT) - return Ellipsis(c->c_arena); - if (NCH(n) == 1 && TYPE(ch) == test) { /* 'step' variable hold no significance in terms of being used over other vars */
