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

@ -101,7 +101,7 @@ namespace vxorg {
} }
if(split.size() > 4) { 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; auto leaf = family_leaf;
for(auto& subvariant : subvariants) { for(auto& subvariant : subvariants) {

View file

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