fix parse bug I accidentally introduced

This commit is contained in:
Lily Tsuru 2024-10-21 12:38:39 -04:00
parent f8285f9e4c
commit 9bdff0be14
2 changed files with 8 additions and 5 deletions

View file

@ -31,7 +31,7 @@ namespace vxorg {
std::string sample_name {};
std::vector<vxorg::VxHeavenItem*> parent_list {};
vxorg::VxHeavenTree::Node* parent = node->parent_node();
while(parent) {
if(parent->data().name.empty())
break;
@ -101,7 +101,7 @@ namespace vxorg {
}
if(split.size() > 4) {
auto subvariants = std::span(split.data() + 4, split.size() - 4);
auto subvariants = std::span(split.data() + 3, split.size() - 3);
auto leaf = family_leaf;
for(auto& subvariant : subvariants) {

View file

@ -13,11 +13,14 @@ int main() {
// walk the resulting tree
tree.walk([](auto* node) {
auto tab_count = node->parent_count();
auto tabulation_level = node->parent_count();
auto& data = node->data();
for(auto i = 0; i < tab_count; ++i)
std::printf("\t");
if(tabulation_level != 0) {
for(auto i = 0; i < tabulation_level; ++i) {
std::printf("\t");
}
}
if(data.name.empty()) {
std::printf("(root)\n");