From 77d634127c535acd78bf109de46758818fa893ae Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Sun, 22 Aug 2010 09:38:05 +0200 Subject: [PATCH] Tokenizer: simplify DECLARE_DYNAMIC and DECLARE_DYNCREATE --- lib/tokenize.cpp | 14 +++++++------- test/testtokenize.cpp | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 4706bcda4..030063eb4 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -8065,13 +8065,6 @@ void Tokenizer::simplifyBuiltinExpect() tok->deleteNext(); tok->deleteNext(); } - else if (Token::Match(tok->next(), "DECLARE_DYNAMIC ( %any% )")) - { - tok->deleteNext(); - tok->deleteNext(); - tok->deleteNext(); - tok->deleteNext(); - } } } @@ -8087,6 +8080,13 @@ void Tokenizer::simplifyMicrosoftMFC() tok->deleteNext(); tok->deleteNext(); } + else if (Token::Match(tok->next(), "DECLARE_DYNAMIC|DECLARE_DYNCREATE ( %any% )")) + { + tok->deleteNext(); + tok->deleteNext(); + tok->deleteNext(); + tok->deleteNext(); + } } } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 437f60eb8..56039b4ca 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -4413,6 +4413,9 @@ private: 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)); + + const char code3[] = "class MyDialog : public CDialog { DECLARE_DYNCREATE(MyDialog) private: CString text; };"; + ASSERT_EQUALS("class MyDialog : public CDialog { private: CString text ; } ;", tokenizeAndStringify(code3,false)); } };