-
-
Notifications
You must be signed in to change notification settings - Fork 791
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
Enhancements to AST traversal #2944
Conversation
* pruning on definition nodes * pruning on statement nodes * early exit list, block and tuple expressions
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.
Hello! Thank you.
Could you add comments to explain the additional logic, and could you remove the cov_mark tool please. We intentionally don't test implementation details as it makes maintaining harder rather than easier.
I provided some additional comments to the code and removed the cov_mark tool. |
* pruning on definition nodes * pruning on statement nodes * early exit list, block and tuple expressions
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.
Thank you
compiler-core/src/ast/tests.rs
Outdated
#[test] | ||
fn find_node_sequence_early_exit() { | ||
let block = compile_expression(r#"{ 1 2 3 }"#); | ||
assert!(block.find_node(1).is_none()); |
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.
Shouldn't this return the block?
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.
Removed the test, but it should not return the block, as the test find_node_sequence() shows.
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.
Thank you!
Could you rebase on main to remove the merge conflict please 🙏 |
I am not really sure how to fix this failing check, sorry. |
Oh yeah there was a vulnerability that apparently was surfaced today. you can fix by running |
34864ed i had to make the same change here to get things working |
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.
Thank you!
This PR is part of my earlier PR on providing pipeline suggestions through the Gleam LSP.
I identified some potential enhancements to the Gleam AST traversal algorithm, and as a result, I made the following changes:
I believe these enhancements will contribute to the overall effectiveness and efficiency of the pipeline suggestion feature.
I welcome any feedback or suggestions for improvement. 😃