MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / findLambdaStartToken

Function findLambdaStartToken

lib/astutils.cpp:3276–3286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3274}
3275
3276const Token *findLambdaStartToken(const Token *last)
3277{
3278 if (!last || !last->isCpp() || last->str() != "}")
3279 return nullptr;
3280 const Token* tok = last->link();
3281 if (Token::simpleMatch(tok->astParent(), "("))
3282 tok = tok->astParent();
3283 if (Token::simpleMatch(tok->astParent(), "["))
3284 return tok->astParent();
3285 return nullptr;
3286}
3287
3288template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
3289static T* findLambdaEndTokenGeneric(T* first)

Callers 2

isExecutableScopeFunction · 0.85

Calls 3

astParentMethod · 0.80
simpleMatchFunction · 0.70
strMethod · 0.45

Tested by 1