mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 06:13:02 +00:00
diagnostics: truncate quoted sources to fit the screen
* src/location.c (min_int, columns): New. (location_caret): Compute the line width. Based on it, compute how many columns must be skipped before the quoted location and truncated after, to fit the sceen width. * tests/local.at (AT_QUELL_VALGRIND): Transform into... (AT_SET_ENV_IF, AT_SET_ENV): these. Define COLUMNS to protect the test suite from the user's environment.
This commit is contained in:
@@ -118,7 +118,8 @@ unsigned location_print (location loc, FILE *out);
|
||||
left-over by the usage of location_caret. */
|
||||
void caret_free (void);
|
||||
|
||||
/* Output to OUT the line and caret corresponding to location LOC. */
|
||||
/* Quote the line containing LOC onto OUT. Highlight the part of LOC
|
||||
with the color STYLE. */
|
||||
void location_caret (location loc, const char* style, FILE *out);
|
||||
|
||||
/* Return -1, 0, 1, depending whether a is before, equal, or
|
||||
|
||||
Reference in New Issue
Block a user