Skip to content

Commit 2f694de

Browse files
committed
2
1 parent 106f6dd commit 2f694de

4 files changed

Lines changed: 205 additions & 301 deletions

File tree

lib/preprocessor.cpp

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -208,26 +208,25 @@ static void addInlineSuppressions(const simplecpp::TokenList &tokens, const Sett
208208
continue;
209209
}
210210

211-
if (polyspace::isPolyspaceComment(tok->str())) {
212-
polyspaceParser.parse(tok->str(), tok->location.line, getRelativeFilename(tokens, tok, settings));
213-
continue;
214-
}
215-
216211
std::list<SuppressionList::Suppression> inlineSuppressions;
217-
if (!parseInlineSuppressionCommentToken(tokens, tok, inlineSuppressions, bad))
218-
continue;
212+
if (polyspace::isPolyspaceComment(tok->str())) {
213+
inlineSuppressions = polyspaceParser.parse(tok->str(), tok->location.line, getRelativeFilename(tokens, tok, settings));
214+
} else {
215+
if (!parseInlineSuppressionCommentToken(tokens, tok, inlineSuppressions, bad))
216+
continue;
219217

220-
if (!sameline(tok->previous, tok)) {
221-
// find code after comment..
222-
if (tok->next) {
223-
tok = tok->next;
218+
if (!sameline(tok->previous, tok)) {
219+
// find code after comment..
220+
if (tok->next) {
221+
tok = tok->next;
224222

225-
while (tok->comment) {
226-
parseInlineSuppressionCommentToken(tokens, tok, inlineSuppressions, bad);
227-
if (tok->next) {
228-
tok = tok->next;
229-
} else {
230-
break;
223+
while (tok->comment) {
224+
parseInlineSuppressionCommentToken(tokens, tok, inlineSuppressions, bad);
225+
if (tok->next) {
226+
tok = tok->next;
227+
} else {
228+
break;
229+
}
231230
}
232231
}
233232
}
@@ -317,8 +316,6 @@ static void addInlineSuppressions(const simplecpp::TokenList &tokens, const Sett
317316
for (const SuppressionList::Suppression & suppr: inlineSuppressionsBlockBegin)
318317
// cppcheck-suppress useStlAlgorithm
319318
bad.emplace_back(suppr.fileName, suppr.lineNumber, 0, "Suppress Begin: No matching end"); // TODO: set column
320-
321-
polyspaceParser.collect(suppressions);
322319
}
323320

324321
void Preprocessor::inlineSuppressions(SuppressionList &suppressions)

0 commit comments

Comments
 (0)