Replies: 1 comment 6 replies
-
I thought |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I think about this while reducing times of visiting useless AST nodes manually.
let’s say we have a macro called
magic_visit_mut
. We could use it likeand the macro will expand as
algorithm
We will start with the node visiting function that is declared in
magic_visit_mut
. If a node could be visited, then all possible parents and children of it could be visited. After the analysis, we will generate noop visiting function for non-visited nodes.And, we could add extra hints for each visitor to help with analysis. Such as
#[magic_visit_mut(wont_visit_children)]
the macro will expand as
I’m not sure how much the performance could be improved, but I guess it wasn’t bad to raise an issue to discuss it.
Beta Was this translation helpful? Give feedback.
All reactions