| 125 | } |
| 126 | |
| 127 | std::unique_ptr<Record> MIParser::parseResultOrAsyncRecord() |
| 128 | { |
| 129 | std::unique_ptr<TupleRecord> result; |
| 130 | |
| 131 | char c = m_lex->lookAhead(); |
| 132 | m_lex->nextToken(); |
| 133 | MATCH_PTR(Token_identifier); |
| 134 | QString reason = QString::fromUtf8(m_lex->currentTokenText()); |
| 135 | m_lex->nextToken(); |
| 136 | |
| 137 | if (c == '^') { |
| 138 | result.reset(new ResultRecord(reason)); |
| 139 | } else { |
| 140 | AsyncRecord::Subkind subkind; |
| 141 | switch (c) { |
| 142 | case '*': subkind = AsyncRecord::Exec; break; |
| 143 | case '=': subkind = AsyncRecord::Notify; break; |
| 144 | case '+': subkind = AsyncRecord::Status; break; |
| 145 | default: |
| 146 | Q_ASSERT(false); |
| 147 | return {}; |
| 148 | } |
| 149 | result.reset(new AsyncRecord(subkind, reason)); |
| 150 | } |
| 151 | |
| 152 | if (m_lex->lookAhead() == ',') { |
| 153 | m_lex->nextToken(); |
| 154 | |
| 155 | if (!parseCSV(*result)) |
| 156 | return {}; |
| 157 | } |
| 158 | |
| 159 | return result; |
| 160 | } |
| 161 | |
| 162 | bool MIParser::parseResult(Result *&result) |
| 163 | { |
nothing calls this directly
no test coverage detected