summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_parser.py2
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/parsermodule.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index 50dc8d1..cae09df 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -106,6 +106,8 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
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 --git a/Misc/NEWS b/Misc/NEWS
index 3da5cc0..e02489b 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -61,6 +61,8 @@ Core and Builtins
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 --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index 05861ed..c0633e3 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -2389,17 +2389,13 @@ validate_atom(node *tree)
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;