Go to the documentation of this file.
20 const std::string &message,
28 auto &out = std::cerr;
56 out << column <<
": ";
66 out << message <<
'\n';
68 const auto file_name = location.
full_path();
69 if(file_name.has_value() && !line.
empty())
72 std::ifstream in(
widen(file_name.value()));
74 std::ifstream in(file_name.value());
78 const auto line_number = std::stoull(
id2string(line));
79 std::string source_line;
80 for(std::size_t l = 0; l < line_number; l++)
81 std::getline(in, source_line);
84 out <<
' ' << source_line <<
'\n';
98 std::cerr << message <<
'\n' << std::flush;
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const irep_idt & get_function() const
static const commandt reset
return to default formatting, as defined by the terminal
const irep_idt & get_column() const
const irep_idt & get_line() const
virtual void print(unsigned level, const std::string &message)=0
static const commandt bright_magenta
render text with bright magenta foreground color
static const commandt bold
render text with bold font
std::string string(const messaget::commandt &c) const
feed a command into a string
const std::string & id2string(const irep_idt &d)
optionalt< std::string > full_path() const
Get a path to the file, including working directory.
std::wstring widen(const char *s)
static const commandt red
render text with red foreground color
void print(unsigned, const xmlt &) override
const irep_idt & get_file() const