mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 12:15:50 +01:00
19 lines
673 B
C++
19 lines
673 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#include "toolchain/diagnostics/mocks.h"
|
|
|
|
namespace Carbon {
|
|
|
|
void PrintTo(const Diagnostic& diagnostic, std::ostream* os) {
|
|
*os << "Diagnostic{"
|
|
<< (diagnostic.level == Diagnostic::Level::Error ? "Error" : "Warning")
|
|
<< ", " << diagnostic.location.file_name << ":"
|
|
<< diagnostic.location.line_number << ":"
|
|
<< diagnostic.location.column_number << ", "
|
|
<< diagnostic.short_name.str() << ", " << diagnostic.message << "}";
|
|
}
|
|
|
|
} // namespace Carbon
|