api.header.include: document it, and fix its default value

While defining api.header.include worked as expected, its default
value was incorrectly defined.  As a result, by default, the generated
parsers still duplicated the content of the generated header instead
of including it.

* data/skeletons/yacc.c (api.header.include): Fix its default value.
* tests/output.at: Check it.
* doc/bison.texi (%define Summary): Document api.header.include.
While at it, move the definition of api.namespace at the proper
place.
This commit is contained in:
Akim Demaille
2020-06-09 07:08:11 +02:00
parent ae5edcc23b
commit a53c6026cd
5 changed files with 112 additions and 34 deletions

20
NEWS
View File

@@ -7,6 +7,26 @@ GNU Bison NEWS
When installed to be relocatable (via configure --enable-relocatable),
bison will now also look for a relocated m4.
** Bug fixes
*** Include the generated header (yacc.c)
Historically, when --defines was used, bison generated a header and pasted
an exact copy of it into the generated parser implementation file. Since
Bison 3.4 it is possible to specify that the header should be `#include`d,
and how. For instance
%define api.header.include {"parse.h"}
or
%define api.header.include {<parser/parse.h>}
Now api.header.include defaults to `"header-basename"`, as was intended in
Bison 3.4, where `header-basename` is the basename of the generated
header. This is disabled when the generated header is `y.tab.h`, to
comply with Automake's ylwrap.
** New features
*** File prefix mapping