18 const std::string &message,
26 auto &out = std::cerr;
54 out << column <<
": ";
68 out << message <<
'\n';
70 const auto file_name = location.
full_path();
71 if(file_name.has_value() && !line.
empty())
77 const auto line_number = std::stoull(
id2string(line));
78 std::string source_line;
79 for(std::size_t l = 0; l < line_number; l++)
80 std::getline(in, source_line);
83 out <<
' ' << source_line <<
'\n';
97 std::cerr << message <<
'\n' << std::flush;
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
std::string string(const messaget::commandt &c) const
feed a command into a string
void print(unsigned, const xmlt &) override
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 reset
return to default formatting, as defined by the terminal
static const commandt bold
render text with bold font
static const commandt red
render text with red foreground color
const irep_idt & get_function() const
const irep_idt & get_column() const
const irep_idt & get_line() const
const irep_idt & get_file() const
std::optional< std::string > full_path() const
Get a path to the file, including working directory.
const std::string & id2string(const irep_idt &d)
#define widen_if_needed(s)