Tokenizer(simplifyGoto): create links for inserted braces.
This commit is contained in:
parent
9569f758f8
commit
9a2a12c333
|
@ -3175,6 +3175,8 @@ void Tokenizer::simplifyGoto()
|
||||||
Token *token = *it;
|
Token *token = *it;
|
||||||
if (token->next()->str() == name)
|
if (token->next()->str() == name)
|
||||||
{
|
{
|
||||||
|
Token *openBrace = NULL;
|
||||||
|
|
||||||
// Delete the "goto name;"
|
// Delete the "goto name;"
|
||||||
token = token->previous();
|
token = token->previous();
|
||||||
token->deleteNext();
|
token->deleteNext();
|
||||||
|
@ -3186,6 +3188,7 @@ void Tokenizer::simplifyGoto()
|
||||||
{
|
{
|
||||||
token->insertToken("{");
|
token->insertToken("{");
|
||||||
token = token->next();
|
token = token->next();
|
||||||
|
openBrace = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert the statements..
|
// Insert the statements..
|
||||||
|
@ -3210,6 +3213,7 @@ void Tokenizer::simplifyGoto()
|
||||||
{
|
{
|
||||||
token->insertToken("}");
|
token->insertToken("}");
|
||||||
token = token->next();
|
token = token->next();
|
||||||
|
Token::createMutualLinks(openBrace, token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue