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

Function tokAtImpl

lib/token.h:892–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

890 static Token *findmatch(Token * startTok, const char pattern[], const Token * end, nonneg int varid = 0);
891
892private:
893 template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
894 static T *tokAtImpl(T *tok, int index)
895 {
896 while (index > 0 && tok) {
897 tok = tok->next();
898 --index;
899 }
900 while (index < 0 && tok) {
901 tok = tok->previous();
902 ++index;
903 }
904 return tok;
905 }
906
907 /**
908 * @throws InternalError thrown if index is out of range

Callers 1

tokAtFunction · 0.85

Calls 1

nextMethod · 0.80

Tested by

no test coverage detected