In AbstractParseTreeVisitor.h I was struggeling over shouldVisitNextChild(node, result))
in the following part (lines 35-48):
virtual std::any visitChildren(ParseTree *node) override {
std::any result = defaultResult();
size_t n = node->children.size();
for (size_t i = 0; i < n; i++) {
if (!shouldVisitNextChild(node, result)) {
break;
}
std::any childResult = node->children[i]->accept(this);
result = aggregateResult(std::move(result), std::move(childResult));
}
return result;
}
Although this function is called in the loop over the children, it tests always the parent. The only validation the function can do is check the result
. Is this its intension?
I would have expected
if (!shouldVisitNextChild(node->children[i], result)) {
break;
}
This would allow to see the focussed node.
New contributor
user25720024 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.