testrunner: some Tokenizer related refactoring#7427
testrunner: some Tokenizer related refactoring#7427firewave merged 10 commits intocppcheck-opensource:mainfrom
Tokenizer related refactoring#7427Conversation
| class SimpleTokenizer2 : public Tokenizer { | ||
| public: | ||
| template<size_t size> | ||
| SimpleTokenizer2(const Settings &settings, ErrorLogger &errorlogger, const char (&code)[size], std::vector<std::string> &files) | ||
| : Tokenizer{settings, errorlogger} | ||
| { | ||
| PreprocessorHelper::preprocess(code, files, *this, errorlogger); | ||
| } | ||
|
|
||
| // TODO: get rid of this | ||
| SimpleTokenizer2(const Settings &settings, ErrorLogger &errorlogger, const char code[], std::vector<std::string> &files) | ||
| : Tokenizer{settings, errorlogger} | ||
| { | ||
| PreprocessorHelper::preprocess(code, files, *this, errorlogger); | ||
| } | ||
| }; | ||
|
|
There was a problem hiding this comment.
This seems like a superficial change but in the quest of untangling the mess around the language handling in TokenList this will shoulder much more in upcoming changes. The application code is actually straight forward but the custom tokenizing in the tests complicates things a lot and keeps giving me headaches.
|
I think some of these patterns can be even more condensed/merged but I will cross that bridge after I have the |
Tokenizer-related refactoringTokenizer related refactoring
…`TestPreprocessor`
| * @return false if source code contains syntax errors | ||
| */ | ||
| template<size_t size> | ||
| bool tokenize(const char (&code)[size], |
There was a problem hiding this comment.
why is this a template. I fear that for almost each test code example there will be a separate function instantiation. And it just seems redundant.
There was a problem hiding this comment.
ok I hope we can fix that later then!
No description provided.