13 void print_caret_impl(std::istream& is,
16 const auto pos = is.tellg();
22 auto buf = std::string{};
24 while (getline(is, buf) && line != loc.begin.line)
28 = loc.begin.line == loc.end.line
33 << std::string(loc.begin.column - 1,
' ')
34 << std::string(std::max(1ul, end_col - loc.begin.column),
'^');
44 print_caret_impl(is, os, loc);
49 std::ostringstream
os;
50 print_caret_impl(is, os, loc);
mutable_automaton< Context > u(const Context &ctx, unsigned n)
The Brzozowski universal witness.
std::string caret(std::istream &is, const rat::location &loc)
Repeat a line with an error, underlining the error with carets.
vcsn::rat::location location
Pairs of positions in a file/stream.
std::ostringstream os
The output stream: the corresponding C++ snippet to compile.
void print_caret(std::istream &is, std::ostream &os, const rat::location &loc)
Repeat a line with an error, underlining the error with carets.