Fixed parsing of "__asm__ volatile {""};"
This commit is contained in:
parent
b0c1c2c819
commit
4cd96158ae
|
@ -458,7 +458,8 @@ std::string Preprocessor::removeComments(const std::string &str, const std::stri
|
||||||
code << str[i++];
|
code << str[i++];
|
||||||
}
|
}
|
||||||
code << '}';
|
code << '}';
|
||||||
}
|
} else
|
||||||
|
--i;
|
||||||
} else if (ch == '#' && previous == '\n') {
|
} else if (ch == '#' && previous == '\n') {
|
||||||
code << ch;
|
code << ch;
|
||||||
previous = ch;
|
previous = ch;
|
||||||
|
|
|
@ -383,6 +383,7 @@ private:
|
||||||
|
|
||||||
ASSERT_EQUALS(" __asm123", preprocessor.removeComments(" __asm123", "3837.cpp"));
|
ASSERT_EQUALS(" __asm123", preprocessor.removeComments(" __asm123", "3837.cpp"));
|
||||||
ASSERT_EQUALS("\" __asm { ; } \"", preprocessor.removeComments("\" __asm { ; } \"", "3837.cpp"));
|
ASSERT_EQUALS("\" __asm { ; } \"", preprocessor.removeComments("\" __asm { ; } \"", "3837.cpp"));
|
||||||
|
ASSERT_EQUALS("__asm__ volatile { \"\" }", preprocessor.removeComments("__asm__ volatile { \"\" }", "3837.cpp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue