Commits

Mark Dickinson  committed d50577c Merge

Issue #14741: Merge fix from 3.2.

  • Participants
  • Parent commits 4815a4a, 2b1cc84

Comments (0)

Files changed (3)

File Lib/test/test_parser.py

         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
 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.
 

File Modules/parsermodule.c

             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;