Tokenizer: minor update to handle C# code better

This commit is contained in:
Daniel Marjamäki 2011-07-16 18:12:55 +02:00
parent 35178cc161
commit 597733bec4
1 changed files with 3 additions and 2 deletions

View File

@ -2142,11 +2142,12 @@ bool Tokenizer::tokenize(std::istream &code,
}
// Simplify JAVA/C# code
if (isJavaOrCSharp() && _files[0].find(".java") != std::string::npos)
if (isJavaOrCSharp())
{
const bool isJava(_files[0].find(".java") != std::string::npos);
for (Token *tok = _tokens; tok; tok = tok->next())
{
if (Token::Match(tok, ") throws %var% {"))
if (isJava && Token::Match(tok, ") throws %var% {"))
Token::eraseTokens(tok, tok->tokAt(3));
else if (tok->str() == "private")
tok->str("private:");