mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +00:00
diagnostics: give m4 precise locations
Currently we pass only the columns based on the screen-width, which is important for the carets. But we don't pass the bytes-based columns, which is important for the colors. Pass both. * src/muscle-tab.c (muscle_boundary_grow): Also pass the byte-based column. * src/location.c (location_caret): Clarify. (boundary_set_from_string): Adjust to the new format. * tests/diagnostics.at (Tabulations and multibyte characters from M4): New.
This commit is contained in:
@@ -275,7 +275,7 @@ muscle_boundary_grow (char const *key, boundary bound)
|
||||
{
|
||||
obstack_sgrow (&muscle_obstack, "[[");
|
||||
obstack_escape (&muscle_obstack, bound.file);
|
||||
obstack_printf (&muscle_obstack, ":%d.%d]]", bound.line, bound.column);
|
||||
obstack_printf (&muscle_obstack, ":%d.%d@@%d]]", bound.line, bound.column, bound.byte);
|
||||
char const *extension = obstack_finish0 (&muscle_obstack);
|
||||
muscle_grow (key, extension, "", "");
|
||||
obstack_free (&muscle_obstack, extension);
|
||||
|
||||
Reference in New Issue
Block a user