@@ -1014,7 +1014,7 @@ unsigned int CppCheck::checkInternal(const FileWithDetails& file, const std::str
10141014 // Parse comments and then remove them
10151015 preprocessor.addRemarkComments (tokens1, mLogger ->remarkComments ());
10161016 preprocessor.inlineSuppressions (tokens1, mSuppressions .nomsg );
1017- tokens1 .removeComments ();
1017+ preprocessor .removeComments (tokens1 );
10181018
10191019 if (!mSettings .buildDir .empty ()) {
10201020 analyzerInformation.reset (new AnalyzerInformation);
@@ -1049,7 +1049,7 @@ unsigned int CppCheck::checkInternal(const FileWithDetails& file, const std::str
10491049 // Do preprocessing on included file
10501050 preprocessor.addRemarkComments (data.tokens , mLogger ->remarkComments ());
10511051 preprocessor.inlineSuppressions (data.tokens , mSuppressions .nomsg );
1052- data. tokens . removeComments ();
1052+ preprocessor. removeComments (data. tokens );
10531053 preprocessor.createDirectives (data.tokens , directives);
10541054 preprocessor.simplifyPragmaAsm (data.tokens );
10551055 // Discover new configurations from included file
@@ -1978,12 +1978,9 @@ bool CppCheck::isPremiumCodingStandardId(const std::string& id) const {
19781978}
19791979
19801980std::string CppCheck::getDumpFileContentsRawTokens (const std::vector<std::string>& files, const simplecpp::TokenList& tokens1) const {
1981- std::string dumpProlog;
1982- dumpProlog += " <rawtokens>\n " ;
1983- dumpProlog += getDumpFileContentsRawTokensHeader (files);
1984- dumpProlog += getDumpFileContentsRawTokensFooter (tokens1);
1985- dumpProlog += " </rawtokens>\n " ;
1986- return dumpProlog;
1981+ std::string header = getDumpFileContentsRawTokensHeader (files);
1982+ std::string footer = getDumpFileContentsRawTokensFooter (tokens1);
1983+ return getDumpFileContentsRawTokens (header, footer);
19871984}
19881985
19891986std::string CppCheck::getDumpFileContentsRawTokens (const std::string& header, const std::string& footer) const {
0 commit comments