mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
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.
This commit is contained in:
@@ -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),
|
||||
"");
|
||||
|
||||
Reference in New Issue
Block a user