Tokenizer(simplifyGoto): create links for inserted braces.

This commit is contained in:
Slava Semushin 2009-08-26 01:58:50 +07:00
parent 9569f758f8
commit 9a2a12c333
1 changed files with 4 additions and 0 deletions

View File

@ -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);
} }
} }
} }