Fix Pattern::Accept

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1048
This commit is contained in:
Mislav Bradac 2017-12-12 16:13:20 +01:00
parent cf7d9070d8
commit 27370b99ff

View File

@ -1074,9 +1074,11 @@ class Pattern : public Tree {
DEFVISITABLE(TreeVisitor<TypedValue>);
bool Accept(HierarchicalTreeVisitor &visitor) override {
if (visitor.PreVisit(*this)) {
identifier_->Accept(visitor);
bool cont = identifier_->Accept(visitor);
for (auto &part : atoms_) {
if (!part->Accept(visitor)) break;
if (cont) {
cont = part->Accept(visitor);
}
}
}
return visitor.PostVisit(*this);