From 9a2a12c333ee69f944c05d5ce63b1cc10414a7e1 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Wed, 26 Aug 2009 01:58:50 +0700 Subject: [PATCH] Tokenizer(simplifyGoto): create links for inserted braces. --- src/tokenize.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 31e70985e..e9cfe823e 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -3175,6 +3175,8 @@ void Tokenizer::simplifyGoto() Token *token = *it; if (token->next()->str() == name) { + Token *openBrace = NULL; + // Delete the "goto name;" token = token->previous(); token->deleteNext(); @@ -3186,6 +3188,7 @@ void Tokenizer::simplifyGoto() { token->insertToken("{"); token = token->next(); + openBrace = token; } // Insert the statements.. @@ -3210,6 +3213,7 @@ void Tokenizer::simplifyGoto() { token->insertToken("}"); token = token->next(); + Token::createMutualLinks(openBrace, token); } } }