diagnostics: fix locations coming from M4

Locations issued from M4 need the byte-based column for the
diagnostics to work properly.  Currently they were unassigned, which
typically resulted in partially non-colored diagnostics.

* src/location.c (boundary_set_from_string): Fix the parsed location.
* src/muscle-tab.c (muscle_percent_define_default): Set the byte values.
* tests/diagnostics.at (Locations from M4): New.
This commit is contained in:
Akim Demaille
2019-04-27 14:39:22 +02:00
parent 91b8f3f171
commit a514c51e55
3 changed files with 39 additions and 12 deletions

View File

@@ -296,7 +296,7 @@ boundary_set_from_string (boundary *bound, char *loc_str)
char *delim = strrchr (loc_str, '.');
aver (delim);
*delim = '\0';
bound->column = atoi (delim+1);
bound->byte = bound->column = atoi (delim+1);
delim = strrchr (loc_str, ':');
aver (delim);
*delim = '\0';