Tokenizer: handle DECLARE_DYNAMIC. Ticket: #1956

This commit is contained in:
Robert Reif 2010-08-21 07:55:14 +02:00 committed by Daniel Marjamäki
parent 7173e01926
commit 9c594684db
2 changed files with 10 additions and 0 deletions

View File

@ -8037,6 +8037,13 @@ void Tokenizer::simplifyBuiltinExpect()
tok->deleteNext(); tok->deleteNext();
tok->deleteNext(); tok->deleteNext();
} }
else if (Token::Match(tok->next(), "DECLARE_DYNAMIC ( %any% )"))
{
tok->deleteNext();
tok->deleteNext();
tok->deleteNext();
tok->deleteNext();
}
} }
} }

View File

@ -4376,6 +4376,9 @@ private:
{ {
const char code1[] = "class MyDialog : public CDialog { DECLARE_MESSAGE_MAP() private: CString text; };"; const char code1[] = "class MyDialog : public CDialog { DECLARE_MESSAGE_MAP() private: CString text; };";
ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code1,false)); ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code1,false));
const char code2[] = "class MyDialog : public CDialog { DECLARE_DYNAMIC(MyDialog) private: CString text; };";
ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code2,false));
} }
}; };