astyle fix

This commit is contained in:
Reijo Tomperi 2009-08-29 23:33:12 +03:00
parent d3118d85c0
commit fc343b3e9e
3 changed files with 6 additions and 6 deletions

View File

@ -2789,7 +2789,7 @@ void Tokenizer::simplifyLogicalOperators()
// "%var%|) and %var%|("
else if (tok->str() == "and" &&
((Token::Match(tok->previous(), "%var%") || tok->previous()->str() == ")") ||
(Token::Match(tok->next(), "%var%") || tok->next()->str() == "(")))
(Token::Match(tok->next(), "%var%") || tok->next()->str() == "(")))
{
tok->str("&&");
}

View File

@ -1037,16 +1037,16 @@ private:
void and1()
{
ASSERT_EQUALS("if ( p && q ) ;",
simplifyLogicalOperators("if (p and q) ;"));
simplifyLogicalOperators("if (p and q) ;"));
ASSERT_EQUALS("if ( foo ( ) && q ) ;",
simplifyLogicalOperators("if (foo() and q) ;"));
simplifyLogicalOperators("if (foo() and q) ;"));
ASSERT_EQUALS("if ( foo ( ) && bar ( ) ) ;",
simplifyLogicalOperators("if (foo() and bar()) ;"));
simplifyLogicalOperators("if (foo() and bar()) ;"));
ASSERT_EQUALS("if ( p && bar ( ) ) ;",
simplifyLogicalOperators("if (p and bar()) ;"));
simplifyLogicalOperators("if (p and bar()) ;"));
}
void comma_keyword()