-
-
Notifications
You must be signed in to change notification settings - Fork 484
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
experiment(ast): rework enum of structures #2877
experiment(ast): rework enum of structures #2877
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
It won't get merged, Instead, we will close this one in favor of #2876. |
let id = expr.ast_node_id().unwrap(); | ||
|
||
assert_eq!(id, AstNodeId::new(6)); | ||
assert_eq!(self.0.nodes().ancestors(id).collect::<Vec<_>>(), vec![6, 5, 4, 3, 2, 1, 0]); |
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.
@Boshen The current node is set as its own first ancestor, Is that the correct behavior? I suspect that it is happening regardless of my changes since I didn't touch any of the tests and they all are passing. But other than this weird observation everything is working as we desire.
If this behavior is fishy let me know so I can compare it with the main branch.
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.
I looked into the implementation and it seems fine to me, If that's the case then this experiment is ready for comments.
…re. (#2881) This would fix the issue found in #2877, As it is right now, the `FinallyClause` gets visited 2 times, once as the Finally and once as a block. This PR addresses this issue by making the `visit_finally_clause` method visit the body statements instead of visiting the block itself. Now it works similar to the `CatchClause`.
As asked by @Boshen in this PR.