summaryrefslogtreecommitdiff
path: root/src/location.h
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-01-22 08:49:12 +0100
committerAkim Demaille <akim.demaille@gmail.com>2020-01-22 22:31:41 +0100
commite6d1289f4ac88a3ac488654544b1c2e3bc567a01 (patch)
tree69bc169f3059e23236de22f505c0cae4badd5af8 /src/location.h
parent16c77b4ba2ece1b52bfd9c381ee8b6226b3e3db5 (diff)
downloadbison-e6d1289f4ac88a3ac488654544b1c2e3bc567a01.tar.gz
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.
Diffstat (limited to 'src/location.h')
-rw-r--r--src/location.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/location.h b/src/location.h
index ccb42e3c..dcb594fb 100644
--- a/src/location.h
+++ b/src/location.h
@@ -126,12 +126,12 @@ void caret_init (void);
left-over by the usage of location_caret. */
void caret_free (void);
-/* Quote the line containing LOC onto OUT. Highlight the part of LOC
- with the color STYLE. */
+/* If -fcaret is enabled, 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);
-/* Display a suggestion of replacement for LOC with S. To call after
- location_caret. */
+/* If -fcaret is enabled, display a suggestion of replacement for LOC
+ with S. To call after location_caret. */
void location_caret_suggestion (location loc, const char *s, FILE *out);
/* Return -1, 0, 1, depending whether a is before, equal, or