Remove some redundant semicolons - part 8

This commit is contained in:
Edoardo Prezioso 2011-12-04 18:56:12 +01:00
parent 4946b036ad
commit 9cadd7c17a
2 changed files with 19 additions and 5 deletions

View File

@ -940,6 +940,10 @@ void Tokenizer::simplifyTypedef()
tok->deleteThis();
tok->deleteThis();
tok->deleteThis();
if (tok->next())
tok->deleteThis();
//now the next token to process is 'tok', not 'tok->next()';
goback = true;
continue;
} else {
const std::string pattern("struct " + tok->strAt(2) + " {|:");
@ -1102,6 +1106,9 @@ void Tokenizer::simplifyTypedef()
if (typeName->str() == "void") {
unsupportedTypedef(typeDef);
tok = deleteInvalidTypedef(typeDef);
if (tok == _tokens)
//now the next token to process is 'tok', not 'tok->next()';
goback = true;
continue;
}
@ -1111,6 +1118,9 @@ void Tokenizer::simplifyTypedef()
Token::Match(tok->linkAt(offset)->tokAt(-3), ":: * %var% ) (")) {
unsupportedTypedef(typeDef);
tok = deleteInvalidTypedef(typeDef);
if (tok == _tokens)
//now the next token to process is 'tok', not 'tok->next()';
goback = true;
continue;
}
@ -1152,6 +1162,9 @@ void Tokenizer::simplifyTypedef()
else {
unsupportedTypedef(typeDef);
tok = deleteInvalidTypedef(typeDef);
if (tok == _tokens)
//now the next token to process is 'tok', not 'tok->next()';
goback = true;
continue;
}
}
@ -1289,6 +1302,9 @@ void Tokenizer::simplifyTypedef()
else {
unsupportedTypedef(typeDef);
tok = deleteInvalidTypedef(typeDef);
if (tok == _tokens)
//now the next token to process is 'tok', not 'tok->next()';
goback = true;
continue;
}

View File

@ -3611,10 +3611,8 @@ private:
"abc e1;\n"
"XYZ e2;";
const char expected[] =
"; "
"int e1 ; "
"int e2 ;";
const char expected[] = "int e1 ; "
"int e2 ;";
ASSERT_EQUALS(expected, tok(code, false));
}
@ -4878,7 +4876,7 @@ private:
" localEntitiyAddFunc_t f;\n"
"}\n";
// The expected result..
const std::string expected("; void f ( ) { int b ; int * f ; }");
const std::string expected("void f ( ) { int b ; int * f ; }");
ASSERT_EQUALS(expected, sizeof_(code, false));
// Check for output..