Replaced %name% with %type%

This commit is contained in:
Daniel Marjamäki 2012-12-31 10:45:37 +01:00
parent 3c915b534d
commit bf169e0c59
2 changed files with 2 additions and 2 deletions

View File

@ -366,7 +366,7 @@ void CheckClass::initializeVarList(const Function &func, std::list<std::string>
if (level == 0 && Token::Match(ftok, "%var% (")) { if (level == 0 && Token::Match(ftok, "%var% (")) {
if (ftok->strAt(2) != ")") if (ftok->strAt(2) != ")")
initVar(ftok->str(), scope, usage); initVar(ftok->str(), scope, usage);
} else if (level == 0 && Token::Match(ftok, "%var% {") && ftok->str() != "const" && Token::Match(ftok->next()->link()->next(), ",|{|%name%")) { } else if (level == 0 && Token::Match(ftok, "%var% {") && ftok->str() != "const" && Token::Match(ftok->next()->link()->next(), ",|{|%type%")) {
initVar(ftok->str(), scope, usage); initVar(ftok->str(), scope, usage);
ftok = ftok->linkAt(1); ftok = ftok->linkAt(1);
} else if (level != 0 && Token::Match(ftok, "%var% =")) // assignment in the initializer: var(value = x) } else if (level != 0 && Token::Match(ftok, "%var% =")) // assignment in the initializer: var(value = x)

View File

@ -1270,7 +1270,7 @@ void SymbolDatabase::addNewFunction(Scope **scope, const Token **tok)
Scope *new_scope = &scopeList.back(); Scope *new_scope = &scopeList.back();
// skip to start of function // skip to start of function
while (tok1 && ((tok1->str() != "{") || (tok1->previous() && tok1->previous()->isName() && tok1->strAt(-1) != "const" && Token::Match(tok1->link()->next(), ",|{|%name%")))) { while (tok1 && ((tok1->str() != "{") || (tok1->previous() && tok1->previous()->isName() && tok1->strAt(-1) != "const" && Token::Match(tok1->link()->next(), ",|{|%type%")))) {
if (tok1->str() == "(" || tok1->str() == "{") if (tok1->str() == "(" || tok1->str() == "{")
tok1 = tok1->link(); tok1 = tok1->link();
tok1 = tok1->next(); tok1 = tok1->next();