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

bpo-41826: add casts for generated C code #22412

Closed
wants to merge 0 commits into from

Conversation

smontanaro
Copy link
Contributor

@smontanaro smontanaro commented Sep 25, 2020

Add casts to C code fragments used by test_peg_generator.

https://bugs.python.org/issue41826

@@ -319,13 +319,13 @@ def test_same_name_different_types(self) -> None:

def test_with_stmt_with_paren(self) -> None:
grammar_source = """
start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) }
start[mod_ty]: a=[statements] ENDMARKER { Module((asdl_stmt_seq *)a, NULL, p->arena) }
statements[asdl_seq*]: a=statement+ { _PyPegen_seq_flatten(p, a) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The types in the rules need to be changed accordingly, for instance:

statements[asdl_seq]*

should become

statements[asdl_stmt_seq*]

Ideally, it should be no asdl_seq left

@pablogsal
Copy link
Member

I tried to push some fixes to your branch but something has happened and GitHub closed the PR :(

@pablogsal
Copy link
Member

Do you mind re-creating the PR? I opened https://github.com/python/cpython/pull/22455/files in case you don't want (I added you as co-author). If you don't mind, you can recreate this PR from the patch in #22455 (https://patch-diff.githubusercontent.com/raw/python/cpython/pull/22455.patch)

@smontanaro smontanaro deleted the bpo-41826 branch February 4, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants