17 virtual void highlight(std::ostream& out)
const = 0;
19 std::string wrapException(
20 const std::exception& e,
21 const std::string& additional =
"") {
22 std::stringstream msg;
23 msg <<
"\n" << e.what() <<
":\n";
24 if (!additional.empty()) {
25 msg << additional <<
":\n";
30 void wrapAndRethrowException(
31 const std::exception& e,
32 const std::string& additional =
"") {
33 throw std::runtime_error(wrapException(e, additional));
37 inline std::ostream& operator<<(std::ostream& out,
const SourceLocation& sl) {
45 void highlight(std::ostream& out)
const override {
Represents a location in source code (for debugging).