Skip to content

Implements AST Customization (#2388) #2394

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

Merged
merged 3 commits into from
Jan 4, 2021
Merged

Implements AST Customization (#2388) #2394

merged 3 commits into from
Jan 4, 2021

Conversation

pca006132
Copy link
Contributor

Tested with cargo test in ast, parser and compiler directory (as cargo test --all would fail to compile for wasm...)

@coolreader18
Copy link
Member

(The clippy error is a separate issue, addressed in #2392)

Is this ready to be merged? Or will you implement custom-type mapping inside rustpython-ast?

@@ -69,6 +69,7 @@ PassStatement: ast::Statement = {
<location:@L> "pass" => {
ast::Statement {
location,
custom: Default::default(),
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason these can't be custom: () as well? If you were looking to eventually have the parser be generic, custom: () can be easily find/replaced eventually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was looking to have the parser be generic later, but () seems to be clearer. will fix.

@pca006132
Copy link
Contributor Author

(The clippy error is a separate issue, addressed in #2392)

Is this ready to be merged? Or will you implement custom-type mapping inside rustpython-ast?

I think custom-type mapping can be done in a separate PR, as that would probably be pretty large, as the AST involves quite a lot of structs.

@coolreader18
Copy link
Member

Could you switch out all the Default::default()s with () ? It's just less noisy, IMO

@coolreader18 coolreader18 merged commit 3dbe94c into RustPython:master Jan 4, 2021
@coolreader18
Copy link
Member

Thanks for contributing!

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.

2 participants