Always by pressing request, oops.
This commit is contained in:
parent
ec0badb651
commit
09bfa66536
|
@ -2625,6 +2625,34 @@ void Tokenizer::simplifyDoublePlusAndDoubleMinus()
|
|||
}
|
||||
}
|
||||
|
||||
void Tokenizer::simplifyJavaAndCSharp()
|
||||
{
|
||||
// better don't call isJava in the loop
|
||||
bool isJava_ = isJava();
|
||||
for (Token *tok = _tokens; tok; tok = tok->next()) {
|
||||
if (tok->str() == "private")
|
||||
tok->str("private:");
|
||||
else if (tok->str() == "protected")
|
||||
tok->str("protected:");
|
||||
else if (tok->str() == "public")
|
||||
tok->str("public:");
|
||||
|
||||
else if (isJava_) {
|
||||
if (Token::Match(tok, ") throws %var% {"))
|
||||
tok->deleteNext(2);
|
||||
} else {
|
||||
if (Token::Match(tok, "%type% [ ] %var% [=;]") &&
|
||||
(!tok->previous() || Token::Match(tok->previous(), "[;{}]"))) {
|
||||
tok->deleteNext(2);
|
||||
tok->insertToken("*");
|
||||
tok = tok->tokAt(2);
|
||||
if (tok->next()->str() == "=")
|
||||
tok = tok->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Specify array size if it hasn't been given */
|
||||
|
||||
void Tokenizer::arraySize()
|
||||
|
|
Loading…
Reference in New Issue