Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pegen: double trailing comma on optional+sequence rules at python generator #85216

Closed
isidentical opened this issue Jun 19, 2020 · 3 comments
Closed

Comments

@isidentical
Copy link
Sponsor Member

BPO 41044
Nosy @pablogsal, @miss-islington, @isidentical
PRs
  • bpo-41044: generate a valid python parser for opt+seq rules #20995
  • [3.9] bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995) #21008
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-06-20.17:51:40.649>
    created_at = <Date 2020-06-19.22:57:19.146>
    labels = []
    title = 'Pegen: double trailing comma on optional+sequence rules at python generator'
    updated_at = <Date 2020-06-20.17:59:39.209>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2020-06-20.17:59:39.209>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-06-20.17:51:40.649>
    closer = 'pablogsal'
    components = []
    creation = <Date 2020-06-19.22:57:19.146>
    creator = 'BTaskaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41044
    keywords = ['patch']
    message_count = 3.0
    messages = ['371908', '371947', '371951']
    nosy_count = 3.0
    nosy_names = ['pablogsal', 'miss-islington', 'BTaskaya']
    pr_nums = ['20995', '21008']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue41044'
    versions = []

    @isidentical
    Copy link
    Sponsor Member Author

    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)

    @pablogsal
    Copy link
    Member

    New changeset 55460ee by Batuhan Taskaya in branch 'master':
    bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)
    55460ee

    @miss-islington
    Copy link
    Contributor

    New changeset 9862181 by Miss Islington (bot) in branch '3.9':
    bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)
    9862181

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants