You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have defined a HandleVariableDeclaration structure and employed traverse_mut to iterate through the nodes in the program. Within the HandleVariableDeclaration structure, I used Traverse and created the enter_program function, where I defined two new structures. If I wish to continue traversing the nodes using either the traverse_mut_with_ctx method or the traverse_mut method, I need to extract scopes and symbols from ctx. This situation results in ctx.scoping() being empty within the HandleVariableDeclaration structure, and the scopes returned by the external traverse_mut are also empty. How can this issue be resolved?
The text was updated successfully, but these errors were encountered:
Yes, I had run semantic analysis before executing Traverse, and the issue arises because in the enter_program method of the HandleVariableDeclaration structure, I extracted the scopes from ctx and assigned them to a new variable. This resulted in ctx.scopes being empty. The current solution is to convert ReusableTraverseCtx back into TraverseCtx and reassign it to ctx at the end. Is there perhaps a better method?
I have defined a HandleVariableDeclaration structure and employed traverse_mut to iterate through the nodes in the program. Within the HandleVariableDeclaration structure, I used Traverse and created the enter_program function, where I defined two new structures. If I wish to continue traversing the nodes using either the traverse_mut_with_ctx method or the traverse_mut method, I need to extract scopes and symbols from ctx. This situation results in ctx.scoping() being empty within the HandleVariableDeclaration structure, and the scopes returned by the external traverse_mut are also empty. How can this issue be resolved?
The text was updated successfully, but these errors were encountered: