Skip to content

Update to the latest ASDL - #93

Merged
MichaReiser merged 6 commits into
RustPython:mainfrom
zanieb:asdl/312
Jul 13, 2023
Merged

MichaReiser merged 6 commits into
RustPython:mainfrom
zanieb:asdl/312

Conversation

@zanieb

@zanieb zanieb commented Jul 10, 2023 •

Copy link
Copy Markdown
Contributor

Uses to latest ASDL to generated code for handling of new generic type syntax. Note this does not otherwise attempt to add handling for the new syntax, the new fields should always be empty.

Required for #82

@fanninpm
fanninpm marked this pull request as ready for review July 10, 2023 21:49
Comment thread parser/src/python.rs
Comment thread ast/src/impls.rs
Comment thread ast/Python.asdl
stmt = FunctionDef(identifier name, arguments args,
stmt* body, expr* decorator_list, expr? returns,
string? type_comment)
string? type_comment, type_param* type_params)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unrelated to this PR: @youknowone do you know if RustPython parses out type_comments or if we could remove this (unused) field?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't parse it now. So removing it is okay right now.
To let RustPython keep the field for AST, changing to the type to empty tuple () will be better than entirely removing it.

Since type_comment is a part of Python3 spec, I thought it is expected to be implemented. CPython parser has an option flag to parse it or not.

@zanieb

zanieb commented Jul 11, 2023

Copy link
Copy Markdown
Contributor Author

@youknowone this should be ready now if you could approve the workflow again

@MichaReiser

Copy link
Copy Markdown
Contributor

@youknowone this looks good to me. I'll go ahead and merge it by tomorrow evening (around now). Let me know if you object and I'll then defer merging too you.

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

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

Successfully merging this pull request may close these issues.

3 participants