MCPcopy Create free account
hub / github.com/KDE/kdevelop / parseResultOrAsyncRecord

Method parseResultOrAsyncRecord

plugins/debuggercommon/mi/miparser.cpp:127–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127std::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
162bool MIParser::parseResult(Result *&result)
163{

Callers

nothing calls this directly

Calls 4

lookAheadMethod · 0.80
currentTokenTextMethod · 0.80
nextTokenMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected