From bc4fb21325f227b34a5c97f73a9badf361c25e73 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Fri, 1 May 2009 20:53:08 +0300 Subject: [PATCH] tokenizer: simplify assembler (#270), fix _asm also. http://apps.sourceforge.net/trac/cppcheck/ticket/270 --- src/tokenize.cpp | 2 +- test/testtokenize.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tokenize.cpp b/src/tokenize.cpp index db1a7bfa6..eacd46069 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -433,7 +433,7 @@ void Tokenizer::tokenize(std::istream &code, const char FileName[]) // Remove __asm.. for (Token *tok = _tokens; tok; tok = tok->next()) { - if (Token::Match(tok->next(), "__asm|asm {")) + if (Token::Match(tok->next(), "__asm|_asm|asm {")) { while (tok->next()) { diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 5541130b6..5d16e981f 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -230,6 +230,11 @@ private: ASSERT_EQUALS("abc def", tokenizeAndStringify(code)); } + { + const char code[] = "abc _asm { mov ax,bx } def"; + ASSERT_EQUALS("abc def", tokenizeAndStringify(code)); + } + { const char code[] = "abc __asm { mov ax,bx } def"; ASSERT_EQUALS("abc def", tokenizeAndStringify(code));