| 5687 | } |
| 5688 | |
| 5689 | bool Tokenizer::simplifyTokenList1(const char FileName[]) |
| 5690 | { |
| 5691 | if (Settings::terminated()) |
| 5692 | return false; |
| 5693 | |
| 5694 | // if MACRO |
| 5695 | for (Token *tok = list.front(); tok; tok = tok->next()) { |
| 5696 | if (Token::Match(tok, "if|for|while %name% (")) { |
| 5697 | if (Token::simpleMatch(tok, "for each")) { |
| 5698 | // 'for each (x in y )' -> 'for (x : y)' |
| 5699 | if (Token* in = Token::findsimplematch(tok->tokAt(2), "in", tok->linkAt(2))) |
| 5700 | in->str(":"); |
| 5701 | tok->deleteNext(); |
| 5702 | } else if (tok->strAt(1) == "constexpr") { |
| 5703 | tok->deleteNext(); |
| 5704 | tok->isConstexpr(true); |
| 5705 | } else { |
| 5706 | syntaxError(tok); |
| 5707 | } |
| 5708 | } |
| 5709 | } |
| 5710 | |
| 5711 | // Is there C++ code in C file? |
| 5712 | validateC(); |
| 5713 | |
| 5714 | // Combine strings and character literals, e.g. L"string", L'c', "string1" "string2" |
| 5715 | combineStringAndCharLiterals(); |
| 5716 | |
| 5717 | // replace inline SQL with "asm()" (Oracle PRO*C). Ticket: #1959 |
| 5718 | simplifySQL(); |
| 5719 | |
| 5720 | createLinks(); |
| 5721 | |
| 5722 | // replace library function calls such as (std::min)(a, b) with std::min(a, b) |
| 5723 | simplifyParenthesizedLibraryFunctions(); |
| 5724 | |
| 5725 | // Simplify debug intrinsics |
| 5726 | simplifyDebug(); |
| 5727 | |
| 5728 | removePragma(); |
| 5729 | |
| 5730 | // Simplify the C alternative tokens (and, or, etc.) |
| 5731 | simplifyCAlternativeTokens(); |
| 5732 | |
| 5733 | simplifyFunctionTryCatch(); |
| 5734 | |
| 5735 | simplifyHeadersAndUnusedTemplates(); |
| 5736 | |
| 5737 | // Remove __asm.. |
| 5738 | simplifyAsm(); |
| 5739 | |
| 5740 | // foo < bar < >> => foo < bar < > > |
| 5741 | if (isCPP() || mSettings.daca) |
| 5742 | splitTemplateRightAngleBrackets(!isCPP()); |
| 5743 | |
| 5744 | // Remove extra "template" tokens that are not used by cppcheck |
| 5745 | removeExtraTemplateKeywords(); |
| 5746 |
nothing calls this directly
no test coverage detected