mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
bpo-40939: Remove the old parser (GH-20768)
This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
This commit is contained in:
parent
311110abcd
commit
1ed83adb0e
53 changed files with 24447 additions and 35978 deletions
|
@ -1,7 +1,7 @@
|
|||
# Python test set -- part 1, grammar.
|
||||
# This just tests whether the parser accepts them all.
|
||||
|
||||
from test.support import check_syntax_error, check_syntax_warning, use_old_parser
|
||||
from test.support import check_syntax_error, check_syntax_warning
|
||||
import inspect
|
||||
import unittest
|
||||
import sys
|
||||
|
@ -1714,69 +1714,53 @@ class GrammarTests(unittest.TestCase):
|
|||
with manager() as x, manager():
|
||||
pass
|
||||
|
||||
if not use_old_parser():
|
||||
test_cases = [
|
||||
"""if 1:
|
||||
with (
|
||||
manager()
|
||||
):
|
||||
pass
|
||||
""",
|
||||
"""if 1:
|
||||
with (
|
||||
manager() as x
|
||||
):
|
||||
pass
|
||||
""",
|
||||
"""if 1:
|
||||
with (
|
||||
manager() as (x, y),
|
||||
manager() as z,
|
||||
):
|
||||
pass
|
||||
""",
|
||||
"""if 1:
|
||||
with (
|
||||
manager(),
|
||||
manager()
|
||||
):
|
||||
pass
|
||||
""",
|
||||
"""if 1:
|
||||
with (
|
||||
manager() as x,
|
||||
manager() as y
|
||||
):
|
||||
pass
|
||||
""",
|
||||
"""if 1:
|
||||
with (
|
||||
manager() as x,
|
||||
manager()
|
||||
):
|
||||
pass
|
||||
""",
|
||||
"""if 1:
|
||||
with (
|
||||
manager() as x,
|
||||
manager() as y,
|
||||
manager() as z,
|
||||
):
|
||||
pass
|
||||
""",
|
||||
"""if 1:
|
||||
with (
|
||||
manager() as x,
|
||||
manager() as y,
|
||||
manager(),
|
||||
):
|
||||
pass
|
||||
""",
|
||||
]
|
||||
for case in test_cases:
|
||||
with self.subTest(case=case):
|
||||
compile(case, "<string>", "exec")
|
||||
with (
|
||||
manager()
|
||||
):
|
||||
pass
|
||||
|
||||
with (
|
||||
manager() as x
|
||||
):
|
||||
pass
|
||||
|
||||
with (
|
||||
manager() as (x, y),
|
||||
manager() as z,
|
||||
):
|
||||
pass
|
||||
|
||||
with (
|
||||
manager(),
|
||||
manager()
|
||||
):
|
||||
pass
|
||||
|
||||
with (
|
||||
manager() as x,
|
||||
manager() as y
|
||||
):
|
||||
pass
|
||||
|
||||
with (
|
||||
manager() as x,
|
||||
manager()
|
||||
):
|
||||
pass
|
||||
|
||||
with (
|
||||
manager() as x,
|
||||
manager() as y,
|
||||
manager() as z,
|
||||
):
|
||||
pass
|
||||
|
||||
with (
|
||||
manager() as x,
|
||||
manager() as y,
|
||||
manager(),
|
||||
):
|
||||
pass
|
||||
|
||||
def test_if_else_expr(self):
|
||||
# Test ifelse expressions in various cases
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue