28 virtual const char*
what() const noexcept
override {
29 std::stringstream msg;
30 msg <<
"\n" <<
ss.str() <<
":\n";
40 mutable std::stringstream
ss;
46 std::cerr << err.
what();
55 #define TC_ASSERT(ctx, cond) \
57 throw ::lang::ErrorReport(ctx) \
58 << __FILE__ << ":" << __LINE__ << ": assertion failed: " << #cond; \
friend const ErrorReport & operator<<(const ErrorReport &e, const T &t)
Definition: error_report.h:50
void highlight(std::ostream &out) const
Definition: lexer.h:315
const ErrorReport & operator<<(const ErrorReport &e, const T &t)
Definition: error_report.h:50
ErrorReport(TreeRef context)
Definition: error_report.h:26
void warn(const ErrorReport &err)
Definition: error_report.h:45
virtual const char * what() const noexceptoverride
Definition: error_report.h:28
SourceRange context
Definition: error_report.h:41
std::stringstream ss
Definition: error_report.h:40
ErrorReport(SourceRange range)
Definition: error_report.h:27
std::string the_message
Definition: error_report.h:42
ErrorReport(const ErrorReport &e)
Definition: error_report.h:23
Definition: error_report.h:22
std::shared_ptr< Tree > TreeRef
Definition: tree.h:44