[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 0/8] RFC: diagnostics: add suggestions
From: |
Akim Demaille |
Subject: |
[PATCH 0/8] RFC: diagnostics: add suggestions |
Date: |
Wed, 2 Oct 2019 08:22:11 +0200 |
This is a reboot of this first attempt:
https://lists.gnu.org/archive/html/bison-patches/2019-02/msg00096.html
The following example shows the result of this series of patches:
Before:
> foo.y:1.1-14: warning: deprecated directive, use '%define parse.error
> verbose' [-Wdeprecated]
> 1 | %error-verbose
> | ^~~~~~~~~~~~~~
> foo.y:4.11-13: error: symbol BaR is used, but is not defined as a token and
> has no rules
> 4 | res: FOOT BaR UNKNOWN
> | ^~~
> foo.y:4.6-9: error: symbol FOOT is used, but is not defined as a token and
> has no rules
> 4 | res: FOOT BaR UNKNOWN
> | ^~~~
> foo.y:4.15-21: error: symbol UNKNOWN is used, but is not defined as a token
> and has no rules
> 4 | res: FOOT BaR UNKNOWN
> | ^~~~~~~
> foo.y: warning: fix-its can be applied. Rerun with option '--update'.
> [-Wother]
After:
> foo.y:1.1-14: warning: deprecated directive: '%error-verbose', use '%define
> parse.error verbose' [-Wdeprecated]
> 1 | %error-verbose
> | ^~~~~~~~~~~~~~
> | %define parse.error verbose
> foo.y:4.11-13: error: symbol 'BaR' is used, but is not defined as a token and
> has no rules; did you mean 'BAR'?
> 4 | res: FOOT BaR UNKNOWN
> | ^~~
> | BAR
> foo.y:4.6-9: error: symbol 'FOOT' is used, but is not defined as a token and
> has no rules; did you mean 'FOO'?
> 4 | res: FOOT BaR UNKNOWN
> | ^~~~
> | FOO
> foo.y:4.15-21: error: symbol 'UNKNOWN' is used, but is not defined as a token
> and has no rules
> 4 | res: FOOT BaR UNKNOWN
> | ^~~~~~~
> foo.y: warning: fix-its can be applied. Rerun with option '--update'.
> [-Wother]
It looks much nicer with colors though, but it seems that imagines are
filtered out from the mailing list.
Cheers!
Akim Demaille (8):
TODO: update
tests: use tput to get the number of columns
diagnostics: isolate caret_set_file
diagnostics: isolate caret_set_column
diagnostics: display suggested update after the caret-info
style: simplify the handling of symbol and semantic_type tables
style: isolate complain_symbol_undeclared
diagnostics: suggest fixes for undeclared symbols
TODO | 22 -----
bootstrap.conf | 3 +-
data/bison-default.css | 5 ++
lib/.gitignore | 5 ++
lib/glthread/.gitignore | 2 +
m4/.gitignore | 5 +-
src/complain.c | 19 ++---
src/location.c | 132 +++++++++++++++++++---------
src/location.h | 4 +
src/symtab.c | 185 ++++++++++++++++++++++------------------
tests/bison.in | 2 +-
tests/diagnostics.at | 24 +++++-
tests/input.at | 25 ++++--
13 files changed, 259 insertions(+), 174 deletions(-)
--
2.23.0
- [PATCH 0/8] RFC: diagnostics: add suggestions,
Akim Demaille <=
- [PATCH 1/8] TODO: update, Akim Demaille, 2019/10/02
- [PATCH 2/8] tests: use tput to get the number of columns, Akim Demaille, 2019/10/02
- [PATCH 3/8] diagnostics: isolate caret_set_file, Akim Demaille, 2019/10/02
- [PATCH 4/8] diagnostics: isolate caret_set_column, Akim Demaille, 2019/10/02
- [PATCH 5/8] diagnostics: display suggested update after the caret-info, Akim Demaille, 2019/10/02
- [PATCH 7/8] style: isolate complain_symbol_undeclared, Akim Demaille, 2019/10/02
- [PATCH 6/8] style: simplify the handling of symbol and semantic_type tables, Akim Demaille, 2019/10/02
- [PATCH 8/8] diagnostics: suggest fixes for undeclared symbols, Akim Demaille, 2019/10/02