This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Pegen: double trailing comma on optional+sequence rules at python generator
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, miss-islington, pablogsal
Priority: normal Keywords: patch

Created on 2020-06-19 22:57 by BTaskaya, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20995 merged BTaskaya, 2020-06-19 23:02
PR 21008 merged miss-islington, 2020-06-20 17:40
Messages (3)
msg371908 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-06-19 22:57
Python generator generates two trailing commas instead of one when both repeat0 (*) + optional ([]) qualifiers used. Example failing test (raises a SyntaxError, since the generated parser can't be parseable / executable)

    def test_opt_sequence(self) -> None:
        grammar = """
        start: [NAME*]
        """
        # This case was failing because of double trailing comma at the end
        # of the generated parser. See bpo-
        make_parser(grammar)
msg371947 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-06-20 17:40
New changeset 55460ee6dc9a4f16bd68d6b6be3a8398c7d4a596 by Batuhan Taskaya in branch 'master':
bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)
https://github.com/python/cpython/commit/55460ee6dc9a4f16bd68d6b6be3a8398c7d4a596
msg371951 - (view) Author: miss-islington (miss-islington) Date: 2020-06-20 17:59
New changeset 98621817504add1e985e2526614921bbe0d24fb6 by Miss Islington (bot) in branch '3.9':
bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)
https://github.com/python/cpython/commit/98621817504add1e985e2526614921bbe0d24fb6
History
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85216
2020-06-20 17:59:39miss-islingtonsetmessages: + msg371951
2020-06-20 17:51:40pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-06-20 17:40:24miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request20182
2020-06-20 17:40:10pablogsalsetnosy: + pablogsal
messages: + msg371947
2020-06-19 23:02:30BTaskayasetkeywords: + patch
stage: patch review
pull_requests: + pull_request20170
2020-06-19 22:57:19BTaskayacreate