Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::lang::ErrorReporter Class Reference

Utility class for reporting errors in the source code. More...

#include <error_reporter.h>

Public Types

using ReportFunc = std::function<void(const CodeLocation&, const std::string&, std::size_t, bool isWarning)>
 A function that reports the error to some sink.

Static Public Member Functions

static void report (const CodeLocation &loc, const std::string &message, std::size_t width=0U, bool isWarning=false)
 Reports an error using the defined function.

Detailed Description

Utility class for reporting errors in the source code.

Member Typedef Documentation

◆ ReportFunc

using sen::lang::ErrorReporter::ReportFunc = std::function<void(const CodeLocation&, const std::string&, std::size_t, bool isWarning)>

A function that reports the error to some sink.

Member Function Documentation

◆ report()

void sen::lang::ErrorReporter::report ( const CodeLocation & loc,
const std::string & message,
std::size_t width = 0U,
bool isWarning = false )
static

Reports an error using the defined function.

Parameters
locthe place where the error is located.
messagehuman-readable error message.
width(optional) width of the error (in characters).
isWarning(optional) true if we should mark the problem as a warning.

The documentation for this class was generated from the following file: