| 3790 | } |
| 3791 | |
| 3792 | void Tokenizer::simplifySQL() |
| 3793 | { |
| 3794 | for (Token *tok = list.front(); tok; tok = tok->next()) { |
| 3795 | if (!Token::simpleMatch(tok, "__CPPCHECK_EMBEDDED_SQL_EXEC__ SQL")) |
| 3796 | continue; |
| 3797 | |
| 3798 | const Token *end = findSQLBlockEnd(tok); |
| 3799 | if (end == nullptr) |
| 3800 | syntaxError(nullptr); |
| 3801 | |
| 3802 | const std::string instruction = tok->stringifyList(end); |
| 3803 | // delete all tokens until the embedded SQL block end |
| 3804 | Token::eraseTokens(tok, end); |
| 3805 | |
| 3806 | // insert "asm ( "instruction" ) ;" |
| 3807 | tok->str("asm"); |
| 3808 | // it can happen that 'end' is NULL when wrong code is inserted |
| 3809 | if (!tok->next()) |
| 3810 | tok->insertToken(";"); |
| 3811 | tok->insertToken(")"); |
| 3812 | tok->insertToken("\"" + instruction + "\""); |
| 3813 | tok->insertToken("("); |
| 3814 | // jump to ';' and continue |
| 3815 | tok = tok->tokAt(3); |
| 3816 | } |
| 3817 | } |
| 3818 | |
| 3819 | void Tokenizer::simplifyParenthesizedLibraryFunctions() |
| 3820 | { |
nothing calls this directly
no test coverage detected