I felt bad for people who have to update their grammar file because of stupid changes such as %define variable names. This series of patches is to free me from guilt.
The diagnostics are improved, there's a new -ffixit option to get support from IDEs/Editors, and now the option --update updates the grammar file with the new directives/variable names (and leaves a backup of the original grammar file). There should be a piece of code, and maybe we should also suggest to use --update at the end of a run where there were fixits. WDYT? It's currently in the "fixits" branch. Akim Demaille (12): diagnostics: style: avoid allocating memory when not needed diagnostics: improve them for %name-prefix regen diagnostics: prefer ^~~~ to ^^^^ to underline code diagnostics: add -ffixit support for deprecated features diagnostics: keep the fixits diagnostics: improve accuracy for deprecated %define variables diagnostics: update the grammar file diagnostics: avoid duplicate warnings for deprecated directives diagnostics: improve the accuracy for %error-verbose regen diagnostics: add fixit support for duplicate removal bootstrap.conf | 8 +- lib/.gitignore | 81 +-- src/complain.c | 2 + src/files.h | 2 +- src/fixits.c | 190 ++++++ src/fixits.h | 32 + src/getargs.c | 24 +- src/getargs.h | 9 +- src/local.mk | 2 + src/location.c | 2 +- src/main.c | 7 + src/muscle-tab.c | 62 +- src/parse-gram.c | 1440 ++++++++++++++++++++++--------------------- src/parse-gram.h | 108 ++-- src/parse-gram.y | 55 +- src/scan-gram.l | 12 +- tests/actions.at | 24 +- tests/c++.at | 6 +- tests/conflicts.at | 12 +- tests/headers.at | 2 +- tests/input.at | 485 ++++++++------- tests/named-refs.at | 96 +-- tests/push.at | 2 +- tests/reduce.at | 30 +- tests/regression.at | 4 +- tests/types.at | 4 +- 26 files changed, 1585 insertions(+), 1116 deletions(-) create mode 100644 src/fixits.c create mode 100644 src/fixits.h -- 2.20.1
