Merge overlapping patterns

This commit is contained in:
Dmitry-Me 2016-08-24 15:10:39 +03:00
parent 6043a27065
commit 667038a402
1 changed files with 2 additions and 2 deletions

View File

@ -100,11 +100,11 @@ void TemplateSimplifier::cleanupAfterSimplify(Token *tokens)
(!tok->previous() || tok->previous()->str() == ";")) { (!tok->previous() || tok->previous()->str() == ";")) {
const Token *tok2 = tok->tokAt(2); const Token *tok2 = tok->tokAt(2);
std::string type; std::string type;
while (Token::Match(tok2, "%type% ,") || Token::Match(tok2, "%num% ,")) { while (Token::Match(tok2, "%type%|%num% ,")) {
type += tok2->str() + ","; type += tok2->str() + ",";
tok2 = tok2->tokAt(2); tok2 = tok2->tokAt(2);
} }
if (Token::Match(tok2, "%type% > (") || Token::Match(tok2, "%num% > (")) { if (Token::Match(tok2, "%type%|%num% > (")) {
type += tok2->str(); type += tok2->str();
tok->str(tok->str() + "<" + type + ">"); tok->str(tok->str() + "<" + type + ">");
Token::eraseTokens(tok, tok2->tokAt(2)); Token::eraseTokens(tok, tok2->tokAt(2));