MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / GetFirstToken

Method GetFirstToken

LuaParser/src/Ast/LuaSyntaxTree.cpp:300–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300std::size_t LuaSyntaxTree::GetFirstToken(std::size_t index) const {
301 if (index < _nodeOrTokens.size()) {
302 auto &n = _nodeOrTokens[index];
303 if (n.Type == NodeOrTokenType::Node) {
304 auto child = n.FirstChild;
305 while (IsNode(child)) {
306 child = GetFirstChild(child);
307 }
308 return child;
309 } else {
310 return index;
311 }
312 }
313 return 0;
314}
315
316std::size_t LuaSyntaxTree::GetLastToken(std::size_t index) const {
317 if (index < _nodeOrTokens.size()) {

Callers 8

AnalyzeChainExprMethod · 0.45
AnalyzeTableFieldMethod · 0.45
AnalyzeCallExpressionMethod · 0.45
AddIgnoreRangeMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected