printTreeAtLevel static method
Implementation
static String printTreeAtLevel(NodeV2 tree, int level) {
String result = "${getSpaced(level)} ${tree.prettyTag}";
result +=
"(${tree.nodeIndexStart}/${tree.textIndexStart} - ${tree.textIndexEnd}/${tree.nodeIndexEnd}): ";
if (tree is SimpleNode) {
result += " ${tree.body}";
}
result += "\n";
for (NodeV2 child in tree.children) {
result += printTreeAtLevel(child, level + 2);
}
return result;
}