[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 8/8] diagnostics: suggest fixes for undeclared symbols
From: |
Akim Demaille |
Subject: |
Re: [PATCH 8/8] diagnostics: suggest fixes for undeclared symbols |
Date: |
Mon, 7 Oct 2019 07:20:17 +0200 |
> Le 6 oct. 2019 à 14:00, Akim Demaille <address@hidden> a écrit :
>
> diff --git a/NEWS b/NEWS
> index a64e3492..fbf9f4cc 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -39,6 +39,27 @@ GNU Bison NEWS
> The gain is typically moderate, but in extreme cases (very simple user
> actions), a 10% improvement can be observed.
>
> +*** Diagnostics with insertion
> +
> + The diagnostics now display suggestion below the underlined source.
> + Replacement for undeclared symbols are now also suggested.
> +
> + $ cat /tmp/foo.y
> + %%
> + list: lis '.' |
> +
> + $ bison -Wall foo.y
> + foo.y:2.7-9: error: symbol 'lis' is used, but is not defined as a token
> and has no rules; did you mean 'list'?
> + 2 | list: lis '.' |
> + | ^~~
> + | list
> + foo.y:2.16: warning: empty rule without %empty [-Wempty-rule]
> + 2 | list: lis '.' |
> + | ^
> + | %empty
> + foo.y: warning: fix-its can be applied. Rerun with option '--update'.
> [-Wother]
That's what it gives in colors:
- [PATCH 1/8] TODO: update, (continued)
- [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