These patches introduce caret errors into Bison. For example,
err.y:4.5-8: error: invalid reference: '$foo'
C: {$foo{bar} };
^^^^
This feature is activated by invoking Bison with -fcaret. This may very well
become the default option is future release the default option is future
releases.
I started implementing this in master, and as I rebased these changes into
maint I noticed that some parts of the code made it difficult to support caret
errors in some situations. Therefore, the carets introduced now are a bit
lacking in some aspects, sorry about that. As a rule of thumb, don't be
surprised if carets are absent from certain errors, this is the only easy way
to keep a sane output (that I know of at the moment).
Also, the option right now is called "--flags", but I don't find this very
insightful, so maybe we should call it "--features" or something instead? I am
well aware that users will prefer the shorthand -f anyways, so this decision is
not life changing :)
Theophile Ranquet (4):
getargs: add support for --flags/-f
errors: show carets
tests: check carets
doc: document carets
NEWS | 13 +++++
doc/bison.texi | 44 ++++++++++++++++
src/complain.c | 3 ++
src/getargs.c | 40 +++++++++++++-
src/getargs.h | 12 +++++
src/location.c | 71 +++++++++++++++++++++++++
src/location.h | 5 ++
src/main.c | 2 +
tests/actions.at | 9 ++++
tests/conflicts.at | 4 ++
tests/input.at | 146 ++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/named-refs.at | 121 +++++++++++++++++++++++++++++++++++++++++++
tests/reduce.at | 55 ++++++++++++++++++++
tests/regression.at | 8 +++
14 files changed, 531 insertions(+), 2 deletions(-)
--
1.8.0