(original) (raw)

changeset: 76824:2b1cc84bf1d9 branch: 3.2 parent: 76822:129289144dfb user: Mark Dickinson mdickinson@enthought.com date: Mon May 07 17:24:04 2012 +0100 files: Lib/test/test_parser.py Misc/NEWS Modules/parsermodule.c description: Issue #14741: Fix missing support for ellipsis in parser module. diff -r 129289144dfb -r 2b1cc84bf1d9 Lib/test/test_parser.py --- a/Lib/test/test_parser.py Mon May 07 16:34:34 2012 +0100 +++ b/Lib/test/test_parser.py Mon May 07 17:24:04 2012 +0100 @@ -106,6 +106,8 @@ self.check_expr("lambda x, *y, **z: 0") self.check_expr("(x for x in range(10))") self.check_expr("foo(x for x in range(10))") + self.check_expr("...") + self.check_expr("a[...]") def test_simple_expression(self): # expr_stmt diff -r 129289144dfb -r 2b1cc84bf1d9 Misc/NEWS --- a/Misc/NEWS Mon May 07 16:34:34 2012 +0100 +++ b/Misc/NEWS Mon May 07 17:24:04 2012 +0100 @@ -61,6 +61,8 @@ Library ------- +- Issue #14741: Fix missing support for Ellipsis ('...') in parser module. + - Issue #14697: Fix missing support for set displays and set comprehensions in parser module. diff -r 129289144dfb -r 2b1cc84bf1d9 Modules/parsermodule.c --- a/Modules/parsermodule.c Mon May 07 16:34:34 2012 +0100 +++ b/Modules/parsermodule.c Mon May 07 17:24:04 2012 +0100 @@ -2389,17 +2389,13 @@ break; case NAME: case NUMBER: + case ELLIPSIS: res = (nch == 1); break; case STRING: for (pos = 1; res && (pos < nch); ++pos) res = validate_ntype(CHILD(tree, pos), STRING); break; - case DOT: - res = (nch == 3 && - validate_ntype(CHILD(tree, 1), DOT) && - validate_ntype(CHILD(tree, 2), DOT)); - break; default: res = 0; break; /mdickinson@enthought.com