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:
Akim Demaille
2019-04-27 16:29:07 +02:00
parent a514c51e55
commit 386cf25088
4 changed files with 65 additions and 25 deletions

View File

@@ -135,7 +135,8 @@ location_cmp (location a, location b)
/* Whether this is the empty location. */
bool location_empty (location loc);
/* LOC_STR must be formatted as 'file:line.column', it will be modified. */
void boundary_set_from_string (boundary *bound, char *loc_str);
/* STR must be formatted as 'file:line.column@byte' or 'file:line.column',
it will be modified. */
void boundary_set_from_string (boundary *bound, char *str);
#endif /* ! defined LOCATION_H_ */