mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 21:33:04 +00:00
diagnostics: handle -fno-caret in the called functions
Don't force callers of location_caret to have to deal with flags that disable it. * src/location.h, src/location.c (location_caret) (location_caret_suggestion): Early return if disabled. * src/complain.c: Simplify.
This commit is contained in:
@@ -400,6 +400,8 @@ caret_set_column (int col)
|
||||
void
|
||||
location_caret (location loc, const char *style, FILE *out)
|
||||
{
|
||||
if (!(feature_flag & feature_caret))
|
||||
return;
|
||||
if (!loc.start.line)
|
||||
return;
|
||||
if (!caret_set_file (loc.start.file))
|
||||
@@ -486,6 +488,8 @@ location_caret (location loc, const char *style, FILE *out)
|
||||
void
|
||||
location_caret_suggestion (location loc, const char *s, FILE *out)
|
||||
{
|
||||
if (!(feature_flag & feature_caret))
|
||||
return;
|
||||
const char *style = "fixit-insert";
|
||||
fprintf (out, " | %*s",
|
||||
loc.start.column - 1 - caret_info.skip
|
||||
|
||||
Reference in New Issue
Block a user