| 160 | } |
| 161 | |
| 162 | bool MIParser::parseResult(Result *&result) |
| 163 | { |
| 164 | // be less strict about the format, see e.g.: |
| 165 | // https://bugs.kde.org/show_bug.cgi?id=304730 |
| 166 | // https://sourceware.org/bugzilla/show_bug.cgi?id=9659 |
| 167 | |
| 168 | std::unique_ptr<Result> res(new Result); |
| 169 | |
| 170 | if (m_lex->lookAhead() == Token_identifier) { |
| 171 | res->variable = QString::fromUtf8(m_lex->currentTokenText()); |
| 172 | m_lex->nextToken(); |
| 173 | |
| 174 | if (m_lex->lookAhead() != '=') { |
| 175 | result = res.release(); |
| 176 | return true; |
| 177 | } |
| 178 | |
| 179 | m_lex->nextToken(); |
| 180 | } |
| 181 | |
| 182 | Value *value = nullptr; |
| 183 | if (!parseValue(value)) |
| 184 | return false; |
| 185 | |
| 186 | res->value = value; |
| 187 | result = res.release(); |
| 188 | |
| 189 | return true; |
| 190 | } |
| 191 | |
| 192 | bool MIParser::parseValue(Value *&value) |
| 193 | { |
nothing calls this directly
no test coverage detected