Run astyle
This commit is contained in:
parent
a645235d5a
commit
c317c8979c
|
@ -2501,7 +2501,7 @@ bool Tokenizer::tokenize(std::istream &code,
|
|||
}
|
||||
|
||||
// Remove redundant consecutive braces, i.e. '.. { { .. } } ..' -> '.. { .. } ..'.
|
||||
for (Token *tok = _tokens; tok; ) {
|
||||
for (Token *tok = _tokens; tok;) {
|
||||
if (Token::simpleMatch(tok, "{ {") && Token::simpleMatch(tok->next()->link(), "} }")) {
|
||||
//remove internal parentheses
|
||||
tok->next()->link()->deleteThis();
|
||||
|
@ -4339,7 +4339,7 @@ bool Tokenizer::simplifyTokenList()
|
|||
simplifyFlowControl();
|
||||
|
||||
// Remove redundant consecutive braces, i.e. '.. { { .. } } ..' -> '.. { .. } ..'.
|
||||
for (Token *tok = _tokens; tok; ) {
|
||||
for (Token *tok = _tokens; tok;) {
|
||||
if (Token::simpleMatch(tok, "{ {") && Token::simpleMatch(tok->next()->link(), "} }")) {
|
||||
//remove internal parentheses
|
||||
tok->next()->link()->deleteThis();
|
||||
|
|
|
@ -7500,9 +7500,9 @@ private:
|
|||
}
|
||||
|
||||
void consecutiveBraces() {
|
||||
ASSERT_EQUALS("void f ( ) { }", tok("void f(){{}}", true));
|
||||
ASSERT_EQUALS("void f ( ) { }", tok("void f(){{{}}}", true));
|
||||
ASSERT_EQUALS("void f ( ) { for ( ; ; ) { } }", tok("void f(){for(;;){}}", true));
|
||||
ASSERT_EQUALS("void f ( ) { }", tok("void f(){{}}", true));
|
||||
ASSERT_EQUALS("void f ( ) { }", tok("void f(){{{}}}", true));
|
||||
ASSERT_EQUALS("void f ( ) { for ( ; ; ) { } }", tok("void f(){for(;;){}}", true));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue