diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 2146c4bf4..a4c006e9d 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -4422,6 +4422,7 @@ bool Tokenizer::simplifyDoWhileAddBracesHelper(Token *tok) { if (tok3->str() == "{") { + // skip all tokens until "}" tok3 = tok3->link(); } else if (tok3->str() == "while") diff --git a/lib/tokenize.h b/lib/tokenize.h index 57924a5b4..c5fe1012a 100644 --- a/lib/tokenize.h +++ b/lib/tokenize.h @@ -108,6 +108,11 @@ public: static void deleteTokens(Token *tok); static const char *getParameterName(const Token *ftok, unsigned int par); + /** + * Get file:line for a given token + * @param tok given token + * @return location for given token + */ std::string fileLine(const Token *tok) const; /** @@ -516,6 +521,10 @@ public: bool duplicateTypedef(Token **tokPtr, const Token *name); void duplicateTypedefError(const Token *tok1, const Token *tok2, const std::string & type); + + /** + * Report error - duplicate declarations + */ void duplicateDeclarationError(const Token *tok1, const Token *tok2, const std::string &type); void unsupportedTypedef(const Token *tok) const;