-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Replace Python parser with ruff parser #5453
Conversation
Thank you so much! Since ruff already has its own ast coworking with same parser, how about starting from ruff side again about it too? |
@qingshi163 @coolreader18 do you also have advices? |
I have to look in this PR, sorry for delay |
# Conflicts: # Cargo.lock # Cargo.toml # compiler/codegen/src/compile.rs # compiler/codegen/src/symboltable.rs # wasm/lib/src/convert.rs
@youknowone I think this is ready to be reviewed now. I went ahead and merged |
@etaloof could you make your fork of RustPython not from qingshi163's but from RustPython org's? Then I can directly push my edits to your PR |
It looks going well. this commit will pin parser version to git version of Ruff c8acbf8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, I feel like everything is going to the right direction.
Is there any blocking issue?
Thank you, I deleted my fork from qingshi163's repository and forked again from RustPython. Could you please open this PR again? Sorry for the confusion. |
a PR is only can be re-opened when the branch is not changed. This one doesn't seem so. Please open a new one. |
Thanks, I have created a new PR #5494. |
This PR replaces the Python parser with the ruff Parser. It is based on the work of the earlier PR #5423 (thanks @qingshi163)! Code generation has been updated and should mostly work now. There is is still some work left to fix the built-in AST module, REPL (probably) and I haven't looked into WASM support.
Running the tests with
cargo test --workspace --exclude rustpython_wasm --features freeze-stdlib
gives me one remaining test failure:test_run_script
insrc/lib.rs
. It seems fail when importing theextra_tests/snippets/dir_main
but I am not sure why that happens.Concerning the AST module: The previous implementation is using a lot of generated code (script). Not sure if we should continue updating this script, I'll look into it. @youknowone do you have any suggestions on this?