summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-09-06 07:06:08 (GMT)
committerGeorg Brandl <georg@python.org>2006-09-06 07:06:08 (GMT)
commit52318d6215f9f9626d38a9b81b52d411dbbdb36a (patch)
tree72563f6321f9265fb9d77702ee729e68048bdd07 /Python/ast.c
parent7cae87ca7b0a3a7ce497cbd335c8ec82fe680476 (diff)
downloadcpython-52318d6215f9f9626d38a9b81b52d411dbbdb36a.zip
cpython-52318d6215f9f9626d38a9b81b52d411dbbdb36a.tar.gz
cpython-52318d6215f9f9626d38a9b81b52d411dbbdb36a.tar.bz2
Patch #1550786: ellipsis literal.
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 36f706e..bb2f3a3 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -399,6 +399,9 @@ set_context(expr_ty e, expr_context_ty ctx, const node *n)
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 @@ ast_for_atom(struct compiling *c, const node *n)
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 @@ ast_for_slice(struct compiling *c, const node *n)
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 */