bison-patches
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]