diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2019-09-27 18:28:19 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2019-10-06 09:54:25 +0200 |
commit | be3cf406afcd68bbf1c113607f3362722f4418d1 (patch) | |
tree | ba19fa11dedeb8ba306533fa6c4c441ebc5f2de9 /src/location.c | |
parent | 126c4622de27197bbe4c6a713f28d114839e636f (diff) | |
download | bison-be3cf406afcd68bbf1c113607f3362722f4418d1.tar.gz |
diagnostics: suggest fixes for undeclared symbols
From
input.y:1.17-19: warning: symbol baz is used, but is not defined as a token and has no rules [-Wother]
1 | %printer {} foo baz
| ^~~
to
input.y:1.17-19: warning: symbol 'baz' is used, but is not defined as a token and has no rules; did you mean 'bar'? [-Wother]
1 | %printer {} foo baz
| ^~~
| bar
* bootstrap.conf: We need fstrcmp.
* src/symtab.c (symbol_from_uniqstr_fuzzy): New.
(complain_symbol_undeclared): Use it.
* tests/diagnostics.at (Suggestions): New.
* data/bison-default.css (insertion): Rename as...
(fixit-insert): this, as this is what GCC uses.
Diffstat (limited to 'src/location.c')
-rw-r--r-- | src/location.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/location.c b/src/location.c index b36f49d3..e6406bd6 100644 --- a/src/location.c +++ b/src/location.c @@ -473,7 +473,7 @@ location_caret (location loc, const char *style, FILE *out) void location_caret_suggestion (location loc, const char *s, FILE *out) { - const char *style = "insertion"; + const char *style = "fixit-insert"; fprintf (out, " | %*s", loc.start.column - 1 - caret_info.skip + (caret_info.skip ? 3 : 0), ""); |