Fixed #8029 (Tokenizer::simplifyCAlternativeTokens: dont simplify 'eb.and + 1')

This commit is contained in:
Daniel Marjamäki 2017-04-30 14:40:41 +02:00
parent 48f1d02355
commit 8a08cc0796
2 changed files with 5 additions and 3 deletions

View File

@ -3361,6 +3361,9 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
// remove __attribute__((?))
simplifyAttribute();
// Combine tokens..
combineOperators();
// Simplify the C alternative tokens (and, or, etc.)
simplifyCAlternativeTokens();
@ -3370,9 +3373,6 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
// combine "- %num%"
concatenateNegativeNumberAndAnyPositive();
// Combine tokens..
combineOperators();
// remove extern "C" and extern "C" {}
if (isCPP())
simplifyExternC();

View File

@ -5771,6 +5771,8 @@ private:
// #6207
ASSERT_EQUALS("void f ( ) { if ( not = x ) { } }", tokenizeAndStringify("void f() { if (not=x){} }", false, true, Settings::Native, "test.c"));
ASSERT_EQUALS("void f ( ) { if ( not = x ) { } }", tokenizeAndStringify("void f() { if (not=x){} }", false, true, Settings::Native, "test.cpp"));
// #8029
ASSERT_EQUALS("void f ( struct S * s ) { x = s . and + 1 ; }", tokenizeAndStringify("void f(struct S *s) { x = s->and + 1; }", false, true, Settings::Native, "test.c"));
}
void simplifyCalculations() {