Tokenizer::simplifyEmptyNamespaces: remove useless condition.
Token::deleteThis handles the !tok->next situation well.
This commit is contained in:
parent
e49cb27f3a
commit
804fbe3f8f
|
@ -3629,16 +3629,14 @@ void Tokenizer::simplifyEmptyNamespaces()
|
|||
continue;
|
||||
if (tok->strAt(3) == "}") {
|
||||
tok->deleteNext(3); // remove '%var% { }'
|
||||
if (tok->next()) { // '%empty% namespace %anytoken%'?
|
||||
if (!tok->previous()) {
|
||||
tok->deleteThis(); // remove 'namespace'
|
||||
goback = true;
|
||||
} else { // '%any% namespace %any%'
|
||||
tok = tok->previous(); // goto previous token
|
||||
tok->deleteNext(); // remove next token: 'namespace'
|
||||
}
|
||||
} else // '%empty% namespace %empty%'?
|
||||
tok->str(";"); // change 'namespace' to ';'
|
||||
if (!tok->previous()) {
|
||||
// remove 'namespace' or replace it with ';' if isolated
|
||||
tok->deleteThis();
|
||||
goback = true;
|
||||
} else { // '%any% namespace %any%'
|
||||
tok = tok->previous(); // goto previous token
|
||||
tok->deleteNext(); // remove next token: 'namespace'
|
||||
}
|
||||
} else {
|
||||
tok = tok->tokAt(2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue