format/j1: fix empty list handling

This commit is contained in:
Tyler Wilding
2024-05-24 22:23:45 -04:00
parent eadfcca261
commit 0e4b6f2c11
229 changed files with 2593 additions and 2759 deletions
+2 -3
View File
@@ -138,9 +138,8 @@ void FormatterTree::construct_formatter_tree_recursive(const std::string& source
}
} else {
construct_formatter_tree_recursive(source, child_node, tree_node, next_node_prefix);
// TODO - im not sure if this is correct
if (node_prefix && !tree_node.refs.empty()) {
tree_node.refs.at(tree_node.refs.size() - 1).node_prefix = node_prefix;
if (next_node_prefix && !tree_node.refs.empty()) {
tree_node.refs.at(tree_node.refs.size() - 1).node_prefix = next_node_prefix;
}
}
}