[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 0/6] diagnostics: improve bison's syntax error messages
From: |
Akim Demaille |
Subject: |
[PATCH 0/6] diagnostics: improve bison's syntax error messages |
Date: |
Thu, 23 Jan 2020 08:50:55 +0100 |
This series of patches plays with parse.error=detailed in bison
itself, and then with parse.error=custom. This was an opportunity to
change bison's syntax errors themselves, so we're going from:
foo.y:1.8-13: error: syntax error, unexpected %token, expecting character
literal or identifier or <tag>
to
foo.y:1.8-13: error: expected character literal or identifier or <tag> before
%token
where the expected tokens ("character literal", "identifier" and
"<tag>") are displayed in green by default, and the unexpected one
("%token") is in red. I'm not sure yet of these choices, comments are
most welcome.
You ought to install the latest version of libtextstyle to avoid some
bugs (currently
https://alpha.gnu.org/gnu/gettext/libtextstyle-0.20.5.tar.gz).
What remains to be done:
- push parsers in yacc
That might force changes in the API, so it should be done before
the following steps
- the other skeletons (anybody?)
- the doc
Cheers!
data/bison-default.css | 3 +
src/complain.c | 80 +++++++++++--
src/complain.h | 5 +
src/parse-gram.c | 257 ++++++++++++-----------------------------
src/parse-gram.h | 4 +-
src/parse-gram.y | 92 ++++++++-------
tests/diagnostics.at | 2 +-
tests/input.at | 18 +--
8 files changed, 212 insertions(+), 249 deletions(-)
--
2.25.0
- [PATCH 0/6] diagnostics: improve bison's syntax error messages,
Akim Demaille <=
- [PATCH 1/6] diagnostics: translate bison's own tokens, Akim Demaille, 2020/01/23
- [PATCH 2/6] regen, Akim Demaille, 2020/01/23
- [PATCH 3/6] diagnostics: report syntax errors in color, Akim Demaille, 2020/01/23
- [PATCH 4/6] regen, Akim Demaille, 2020/01/23
- [PATCH 6/6] regen, Akim Demaille, 2020/01/23
- [PATCH 5/6] diagnostics: modernize bison's syntax errors, Akim Demaille, 2020/01/23
- Re: [PATCH 0/6] diagnostics: improve bison's syntax error messages, Akim Demaille, 2020/01/25