Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 15 additions & 1 deletion test/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,23 @@ std::map<std::string, std::string> PreprocessorHelper::getcode(const Settings& s

void PreprocessorHelper::preprocess(const char code[], std::vector<std::string> &files, Tokenizer& tokenizer, ErrorLogger& errorlogger)
{
preprocess(code, files, tokenizer, errorlogger, simplecpp::DUI());
// TODO: make sure the given Tokenizer has not been used yet

// TODO: get rid of stream
std::istringstream istr(code);
const simplecpp::TokenList tokens1(istr, files, files[0]);

Preprocessor preprocessor(tokenizer.getSettings(), errorlogger);
simplecpp::TokenList tokens2 = preprocessor.preprocess(tokens1, "", files, true);

// Tokenizer..
tokenizer.list.createTokens(std::move(tokens2));

std::list<Directive> directives = preprocessor.createDirectives(tokens1);
tokenizer.setDirectives(std::move(directives));
}

// TODO: get rid of this
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not change this function because the only user of this will go away in an upcoming PR.

void PreprocessorHelper::preprocess(const char code[], std::vector<std::string> &files, Tokenizer& tokenizer, ErrorLogger& errorlogger, const simplecpp::DUI& dui)
{
// TODO: make sure the given Tokenizer has not been used yet
Expand Down
Loading