mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
af157fad28
commit
55460ee6dc
2 changed files with 15 additions and 1 deletions
|
@ -493,6 +493,14 @@ class TestPegen(unittest.TestCase):
|
|||
# Would assert False without a special case in compute_left_recursives().
|
||||
make_parser(grammar)
|
||||
|
||||
def test_opt_sequence(self) -> None:
|
||||
grammar = """
|
||||
start: [NAME*]
|
||||
"""
|
||||
# This case was failing because of a double trailing comma at the end
|
||||
# of a line in the generated source. See bpo-41044
|
||||
make_parser(grammar)
|
||||
|
||||
def test_left_recursion_too_complex(self) -> None:
|
||||
grammar = """
|
||||
start: foo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue