Skip to content

Commit 943cab2

Browse files
committed
Issue #14741: Merge fix from 3.2.
2 parents 72f6095 + da029fb commit 943cab2

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/test/test_parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def test_expressions(self):
110110
self.check_expr("lambda x, *y, **z: 0")
111111
self.check_expr("(x for x in range(10))")
112112
self.check_expr("foo(x for x in range(10))")
113+
self.check_expr("...")
114+
self.check_expr("a[...]")
113115

114116
def test_simple_expression(self):
115117
# expr_stmt

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Core and Builtins
2020
Library
2121
-------
2222

23+
- Issue #14741: Fix missing support for Ellipsis ('...') in parser module.
24+
2325
- Issue #14697: Fix missing support for set displays and set comprehensions in
2426
parser module.
2527

Modules/parsermodule.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,17 +2419,13 @@ validate_atom(node *tree)
24192419
break;
24202420
case NAME:
24212421
case NUMBER:
2422+
case ELLIPSIS:
24222423
res = (nch == 1);
24232424
break;
24242425
case STRING:
24252426
for (pos = 1; res && (pos < nch); ++pos)
24262427
res = validate_ntype(CHILD(tree, pos), STRING);
24272428
break;
2428-
case DOT:
2429-
res = (nch == 3 &&
2430-
validate_ntype(CHILD(tree, 1), DOT) &&
2431-
validate_ntype(CHILD(tree, 2), DOT));
2432-
break;
24332429
default:
24342430
res = 0;
24352431
break;

0 commit comments

Comments
 (0)