GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [WIP] Use Ruff Parser by qingshi163 · Pull Request #5423 · RustPython/RustPython Conversation
|
|
I am glad to see this, awesome. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I was also wondering if this would be possible! Very cool :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
There is a proc macro panic witch I did not understand. Could you try to solve it? @youknowone |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // ext_modules!( | ||
| // iter, | ||
| // dir = "./Lib/python_builtins", | ||
| // crate_name = "rustpython_compiler_core" | ||
| // ); |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I am sorry to be late.
The error caused when compiling Lib/python_builtins/__phello__/spam.py
Parsing step is ok, but compiling fails.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| res.map_err(|e| e.into_codegen_error(source_path.to_owned()).into()) | ||
| res.map_err(|e| e.into_codegen_error(source_code.path.to_owned()).into()) | ||
| } | ||
|
|
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find the root cause yet, but adding this test will make using debugger or backtrace easy for the problem
| #[test] | |
| fn test_compile_phello() { | |
| let code = r#" | |
| initialized = True | |
| def main(): | |
| print("Hello world!") | |
| if __name__ == '__main__': | |
| main() | |
| "#; | |
| let compiled = compile(&code, Mode::Exec, "<>", CompileOpts::default()); | |
| dbg!(compiled.expect("compile error")); | |
| } |
running with
cargo test --manifest-path compiler/Cargo.toml
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi, what is the status on PR? I can work on this if needed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@etaloof Could you please help? This PR need additonal works to make the upper commented new test passes |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sure, should I make a new PR when I am done? I don't think Github allows me to add my commits here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // If there are type params, we need to push a special symbol table just for them | ||
| if !type_params.is_empty() { | ||
| if !type_params.is_some() { | ||
| self.push_symbol_table(); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@qingshi163 @youknowone: This is the source of the bug.
As the comment says, // If there are type params, we need to push a special symbol table just for them, but the change to !type_params.is_some() (as in type_params.is_none()) pushes if there are NO params, causing the panic! in push_symbol_table. On my machine changing to
if type_params.is_some() { self.push_symbol_table(); }
allows test_compile_phello to pass.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
# Conflicts: # Cargo.lock # Cargo.toml # compiler/codegen/src/compile.rs # compiler/codegen/src/symboltable.rs # wasm/lib/src/convert.rs
|
oh no... I forget to reset upstream to @etaloof's, now it is pushed here |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Superseded by #5494 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Replace parser
There was an error while loading. Please reload this page.