bool operator==(const SourceLocation &a, const SourceLocation &b) { return a.line() == b.line() && a.column() == b.column() && a.offset() == b.offset() && a.fileName() == b.fileName() ; }
void PrintTo(const SourceLocation &sourceLocation, std::ostream *os) { *os << sourceLocation.filePath().constData() << ", line: " << sourceLocation.line() << ", column: "<< sourceLocation.column() << ", offset: "<< sourceLocation.offset(); }
void PrintTo(const SourceLocation &sourceLocation, std::ostream *os) { auto filePath = sourceLocation.filePath(); if (filePath.hasContent()) *os << filePath.constData() << ", "; *os << "line: " << sourceLocation.line() << ", column: "<< sourceLocation.column() << ", offset: "<< sourceLocation.offset(); }
QDebug operator<<(QDebug dbg, const SourceLocation &location) { dbg.nospace() << location.fileName() << " [" << location.line() << ":" << location.column() << "(" << location.offset() << ")]"; return dbg.space(); }