forked from qt-creator/qt-creator
Output parsers: Replace the chaining approach
Use "flat" aggregation instead. This is another step towards the formatter/parser merger. Along the way, also fix some some subclasses (mostly in BareMetal) that erroneously forwarded handled output to other parsers. Task-number: QTCREATORBUG-22665 Change-Id: I12947349ca663d2e6bbfc99efd069d69e2b54969 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -35,16 +35,15 @@
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
void LldParser::handleLine(const QString &line, Utils::OutputFormat type)
|
||||
IOutputParser::Status LldParser::doHandleLine(const QString &line, Utils::OutputFormat type)
|
||||
{
|
||||
if (type != Utils::StdErrFormat) {
|
||||
IOutputParser::handleLine(line, type);
|
||||
return;
|
||||
}
|
||||
if (type != Utils::StdErrFormat)
|
||||
return Status::NotHandled;
|
||||
|
||||
const QString trimmedLine = rightTrimmed(line);
|
||||
if (trimmedLine.contains("error:") && trimmedLine.contains("lld")) {
|
||||
emit addTask(CompileTask(Task::Error, trimmedLine));
|
||||
return;
|
||||
return Status::Done;
|
||||
}
|
||||
static const QStringList prefixes{">>> referenced by ", ">>> defined at ", ">>> "};
|
||||
for (const QString &prefix : prefixes) {
|
||||
@@ -70,9 +69,9 @@ void LldParser::handleLine(const QString &line, Utils::OutputFormat type)
|
||||
trimmedLine.mid(filePathOffset, filePathLen).trimmed());
|
||||
emit addTask(CompileTask(Task::Unknown, trimmedLine.mid(4).trimmed(),
|
||||
absoluteFilePath(file), lineNo));
|
||||
return;
|
||||
return Status::Done;
|
||||
}
|
||||
IOutputParser::handleLine(line, Utils::StdErrFormat);
|
||||
return Status::NotHandled;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user