cpython: d50577c5711b (original) (raw)
Mercurial > cpython
changeset 76825:d50577c5711b
Issue #14741: Merge fix from 3.2. [#14741]
Mark Dickinson mdickinson@enthought.com | |
---|---|
date | Mon, 07 May 2012 17:25:14 +0100 |
parents | 4815a4a4a852(current diff)2b1cc84bf1d9(diff) |
children | d6324941b739 |
files | Lib/test/test_parser.py Misc/NEWS Modules/parsermodule.c |
diffstat | 3 files changed, 5 insertions(+), 5 deletions(-)[+] [-] Lib/test/test_parser.py 2 Misc/NEWS 2 Modules/parsermodule.c 6 |
line wrap: on
line diff
--- a/Lib/test/test_parser.py +++ b/Lib/test/test_parser.py @@ -110,6 +110,8 @@ class RoundtripLegalSyntaxTestCase(unitt 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("...")[](#l1.7)
self.check_expr("a[...]")[](#l1.8)
def test_simple_expression(self): # expr_stmt
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -20,6 +20,8 @@ Core and Builtins Library ------- +- Issue #14741: Fix missing support for Ellipsis ('...') in parser module. +
--- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -2419,17 +2419,13 @@ validate_atom(node *tree) break; case NAME: case NUMBER:
case ELLIPSIS:[](#l3.7) res = (nch == 1);[](#l3.8) break;[](#l3.9) case STRING:[](#l3.10) for (pos = 1; res && (pos < nch); ++pos)[](#l3.11) res = validate_ntype(CHILD(tree, pos), STRING);[](#l3.12) break;[](#l3.13)
case DOT:[](#l3.14)
res = (nch == 3 &&[](#l3.15)
validate_ntype(CHILD(tree, 1), DOT) &&[](#l3.16)
validate_ntype(CHILD(tree, 2), DOT));[](#l3.17)
break;[](#l3.18) default:[](#l3.19) res = 0;[](#l3.20) break;[](#l3.21)