Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,18 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
CheckUnusedFunctions checkUnusedFunctions(nullptr, nullptr, nullptr);

try {
if (mSettings.library.markupFile(filename)) {
Tokenizer tokenizer(mSettings, this);
if (fileStream)
tokenizer.list.createTokens(*fileStream, filename);
else {
std::ifstream in(filename);
tokenizer.list.createTokens(in, filename);
}
checkUnusedFunctions.getFileInfo(&tokenizer, &mSettings);
return EXIT_SUCCESS;
}

Preprocessor preprocessor(mSettings, this);
std::set<std::string> configurations;

Expand Down Expand Up @@ -662,13 +674,6 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
return mExitCode;
}

if (mSettings.library.markupFile(filename)) {
Tokenizer tokenizer(mSettings, this, &preprocessor);
tokenizer.createTokens(std::move(tokens1));
checkUnusedFunctions.getFileInfo(&tokenizer, &mSettings);
return EXIT_SUCCESS;
}

if (!preprocessor.loadFiles(tokens1, files))
return mExitCode;

Expand Down