Skip to content

Commit

Permalink
Run astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjfox committed Nov 14, 2011
1 parent a645235 commit c317c89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions test/testsimplifytokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7500,9 +7500,9 @@ class TestSimplifyTokens : public TestFixture {
}

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

Expand Down

0 comments on commit c317c89

Please sign in to comment.