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

Method GetLastToken

LuaParser/src/Ast/LuaSyntaxTree.cpp:316–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316std::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
332std::size_t LuaSyntaxTree::GetPrevToken(std::size_t index) const {
333 if (index == 0) {

Callers 8

SpaceRightMethod · 0.45
TableFieldAddSepMethod · 0.45
AnalyzeCallExpressionMethod · 0.45
AnalyzeDocFormatMethod · 0.45
AddIgnoreRangeMethod · 0.45
BreakAfterMethod · 0.45
CancelBreakAfterMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected