-
Notifications
You must be signed in to change notification settings - Fork 270
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
Added is present check to traversals #1401
base: master
Are you sure you want to change the base?
Conversation
This can't be done generally. FreeSymbolsVisitor is the only one that can ignore the subtree. For example |
Okay, understood. So, I'll have to use |
@isuruf Will the above mentioned data structure be sufficient for this purpose? |
It will be for SubsVisitor, but not for other visitors. |
Can you please suggest me an approach regarding other Visitors? |
It depends on the visitor. You'll need to fix them one by one. |
@@ -88,7 +98,7 @@ class FreeSymbolsVisitor : public BaseVisitor<FreeSymbolsVisitor> | |||
} | |||
s.insert(set_.begin(), set_.end()); | |||
for (const auto &p : x.get_point()) { | |||
auto iter = v.insert(p->rcp_from_this()); | |||
auto iter = has_visited.insert(p->rcp_from_this()); |
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.
doesn't it should be v.has_visited.insert(p->rcp_from_this());
Relevant: #1386 cc @isuruf