| 92 | } |
| 93 | |
| 94 | std::vector<LuaSyntaxNode> LuaSyntaxNode::GetDescendants(const LuaSyntaxTree &t) const { |
| 95 | std::vector<LuaSyntaxNode> results; |
| 96 | if (t.GetFirstChild(_index) == 0) { |
| 97 | return results; |
| 98 | } |
| 99 | |
| 100 | int accessIndex = -1; |
| 101 | LuaSyntaxNode node = *this; |
| 102 | do { |
| 103 | if (node.IsNode(t)) { |
| 104 | for (auto child = node.GetFirstChild(t); !child.IsNull(t); child.ToNext(t)) { |
| 105 | results.emplace_back(child); |
| 106 | } |
| 107 | } |
| 108 | accessIndex++; |
| 109 | } while (accessIndex < static_cast<int>(results.size())); |
| 110 | return results; |
| 111 | } |
| 112 | |
| 113 | std::vector<LuaSyntaxNode> LuaSyntaxNode::GetChildren(const LuaSyntaxTree &t) const { |
| 114 | std::vector<LuaSyntaxNode> results; |
nothing calls this directly
no test coverage detected