Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit da029fb

Browse files
committed
Issue #14741: Fix missing support for ellipsis in parser module.
1 parent 11c1dee commit da029fb

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
@@ -106,6 +106,8 @@ def test_expressions(self):
106106
self.check_expr("lambda x, *y, **z: 0")
107107
self.check_expr("(x for x in range(10))")
108108
self.check_expr("foo(x for x in range(10))")
109+
self.check_expr("...")
110+
self.check_expr("a[...]")
109111

110112
def test_simple_expression(self):
111113
# expr_stmt

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Core and Builtins
6161
Library
6262
-------
6363

64+
- Issue #14741: Fix missing support for Ellipsis ('...') in parser module.
65+
6466
- Issue #14697: Fix missing support for set displays and set comprehensions in
6567
parser module.
6668

Modules/parsermodule.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,17 +2389,13 @@ validate_atom(node *tree)
23892389
break;
23902390
case NAME:
23912391
case NUMBER:
2392+
case ELLIPSIS:
23922393
res = (nch == 1);
23932394
break;
23942395
case STRING:
23952396
for (pos = 1; res && (pos < nch); ++pos)
23962397
res = validate_ntype(CHILD(tree, pos), STRING);
23972398
break;
2398-
case DOT:
2399-
res = (nch == 3 &&
2400-
validate_ntype(CHILD(tree, 1), DOT) &&
2401-
validate_ntype(CHILD(tree, 2), DOT));
2402-
break;
24032399
default:
24042400
res = 0;
24052401
break;

0 commit comments

Comments
 (0)