Merge pull request #618 from simartin/simplifyEnum_code_simplification
Simplify the code handling C++0x typed enumerations.
This commit is contained in:
commit
23402b9b44
|
@ -7593,22 +7593,15 @@ void Tokenizer::simplifyEnum()
|
||||||
if (tok->next()->str() == ":") {
|
if (tok->next()->str() == ":") {
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
|
|
||||||
if (!tok->next() || !tok->next()->isName()) {
|
typeTokenStart = tok->next();
|
||||||
syntaxError(tok);
|
typeTokenEnd = 0;
|
||||||
return; // can't recover
|
|
||||||
}
|
|
||||||
|
|
||||||
tok = tok->next();
|
while (tok->next() && Token::Match(tok->next(), "::|%type%")) {
|
||||||
typeTokenStart = tok;
|
typeTokenEnd = tok->next();
|
||||||
typeTokenEnd = typeTokenStart;
|
|
||||||
|
|
||||||
while (typeTokenEnd->next() && (typeTokenEnd->next()->str() == "::" ||
|
|
||||||
Token::Match(typeTokenEnd->next(), "%type%"))) {
|
|
||||||
typeTokenEnd = typeTokenEnd->next();
|
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tok->next()) {
|
if (!tok->next() || !typeTokenEnd) {
|
||||||
syntaxError(tok);
|
syntaxError(tok);
|
||||||
return; // can't recover
|
return; // can't recover
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue