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

Method CountNodeChild

LuaParser/src/Ast/LuaSyntaxNode.cpp:285–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285std::size_t LuaSyntaxNode::CountNodeChild(LuaSyntaxNodeKind kind, const LuaSyntaxTree &t) {
286 auto count = 0;
287 for (auto child = GetFirstChild(t); !child.IsNull(t); child.ToNext(t)) {
288 if (child.GetSyntaxKind(t) == kind) {
289 count++;
290 }
291 }
292 return count;
293}
294
295bool LuaSyntaxNode::IsEmpty(const LuaSyntaxTree &t) const {
296 return t.GetFirstChild(_index) == 0;

Callers

nothing calls this directly

Calls 3

ToNextMethod · 0.80
GetSyntaxKindMethod · 0.80
IsNullMethod · 0.45

Tested by

no test coverage detected