- return name_string () + ":" + to_string (get_line (context_str0))
- + ":" + to_string (get_char (context_str0));
+ {
+ int l, ch, col, offset;
+ get_counts (context_str0, &l, &ch, &col, &offset);
+
+ return name_string () + ":" + to_string (l)
+ + ":" + to_string (col);
+ }
+}
+
+string
+Source_file::quote_input (char const *pos_str0) const
+{
+ if (!contains (pos_str0))
+ return " (" + _ ("position unknown") + ")";
+
+ int l, ch, col, offset;
+ get_counts (pos_str0, &l, &ch, &col, &offset);
+ string line = line_string (pos_str0);
+ string context = line.substr (0, offset)
+ + to_string ('\n')
+ + to_string (' ', col)
+ + line.substr (offset, line.length () - offset);
+ return context;