Run astyle

This commit is contained in:
Thomas Jarosch 2011-11-14 09:21:42 +01:00
parent a645235d5a
commit c317c8979c
2 changed files with 5 additions and 5 deletions

View File

@ -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();

View File

@ -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));
}
};