From 3703e71f82cf430b21541e649a9bee584b7b5631 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Tue, 9 Oct 2012 18:21:35 +0200 Subject: [PATCH] Related to previous commit: if the '{}' parenthesis are found after 'case', don't skip them after continuing to the main loop or it will cause indentlevel mismatching. --- lib/tokenize.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 84209498b..437654947 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2386,10 +2386,11 @@ void Tokenizer::simplifyLabelsCaseDefault() if (Token::Match(tok, "[;{}] case")) { while (NULL != (tok = tok->next())) { - if (Token::Match(tok,"[:{};]")) + if (Token::Match(tok->next(),"[:{};]")) break; } - if (tok->str() == ":" && tok->next()->str() != ";") { + if (tok->next()->str() == ":" && tok->strAt(2) != ";") { + tok = tok->next(); tok->insertToken(";"); } } else if (Token::Match(tok, "[;{}] %var% : !!;")) {