| 314 | } |
| 315 | |
| 316 | std::size_t LuaSyntaxTree::GetLastToken(std::size_t index) const { |
| 317 | if (index < _nodeOrTokens.size()) { |
| 318 | auto &n = _nodeOrTokens[index]; |
| 319 | if (n.Type == NodeOrTokenType::Node) { |
| 320 | auto child = n.LastChild; |
| 321 | while (IsNode(child)) { |
| 322 | child = GetLastChild(child); |
| 323 | } |
| 324 | return child; |
| 325 | } else { |
| 326 | return index; |
| 327 | } |
| 328 | } |
| 329 | return 0; |
| 330 | } |
| 331 | |
| 332 | std::size_t LuaSyntaxTree::GetPrevToken(std::size_t index) const { |
| 333 | if (index == 0) { |
no test coverage detected