Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': in progress..

This commit is contained in:
Edoardo Prezioso 2012-01-30 13:15:25 +01:00
parent 017f0090fa
commit d9e9c0aceb
1 changed files with 17 additions and 8 deletions

View File

@ -1014,18 +1014,27 @@ void Tokenizer::simplifyTypedef()
tokOffset = tokOffset->next(); tokOffset = tokOffset->next();
} }
typeEnd = tok->tokAt(offset++); ++offset;
typeEnd = tokOffset;
tokOffset = tokOffset->next();
bool atEnd = false; bool atEnd = false;
while (!atEnd) { while (!atEnd) {
if (Token::simpleMatch(tok->tokAt(offset), "::")) if (tokOffset && tokOffset->str() == "::") {
typeEnd = tok->tokAt(offset++); ++offset;
typeEnd = tokOffset;
tokOffset = tokOffset->next();
}
if (Token::Match(tok->tokAt(offset), "%type%") && if (Token::Match(tokOffset, "%type%") &&
tok->tokAt(offset + 1) && !Token::Match(tok->tokAt(offset + 1), "[|;|,|(")) tokOffset->next() && !Token::Match(tokOffset->next(), "[|;|,|(")) {
typeEnd = tok->tokAt(offset++); ++offset;
else if (Token::simpleMatch(tok->tokAt(offset), "const (")) { typeEnd = tokOffset;
typeEnd = tok->tokAt(offset++); tokOffset = tokOffset->next();
} else if (Token::simpleMatch(tokOffset, "const (")) {
++offset;
typeEnd = tokOffset;
tokOffset = tokOffset->next();
atEnd = true; atEnd = true;
} else } else
atEnd = true; atEnd = true;