2021-01-24  Akim Demaille  <akim.demaille@gmail.com>

	version 3.7.5
	* NEWS: Record release date.

2021-01-24  Akim Demaille  <akim.demaille@gmail.com>

	tables: fix handling for useless tokens
	In some rare conditions, the generated parser can be wrong when there
	are useless tokens.

	Reported by Balázs Scheidler.
	https://github.com/akimd/bison/issues/72

	Balázs managed to prove that the bug was introduced in

	    commit af1c6f973a60a51c609903713ff8f7fce0887025
	    Author: Theophile Ranquet <ranquet@lrde.epita.fr>
	    Date:   Tue Nov 13 10:38:49 2012 +0000

	    tables: use bitsets for a performance boost

	    Suggested by Yuri at
	    <http://lists.gnu.org/archive/html/bison-patches/2012-01/msg00000.html>.

	    The improvement is marginal for most grammars, but notable for large
	    grammars (e.g., PosgreSQL's postgre.y), and very large for the
	    sample.y grammar submitted by Yuri in
	    http://lists.gnu.org/archive/html/bison-patches/2012-01/msg00012.html.
	    Measured with --trace=time -fsyntax-only.

	    parser action tables    postgre.y     sample.y
	    Before                 0,129 (44%)  37,095 (99%)
	    After                  0,117 (42%)   5,046 (93%)

	    * src/tables.c (pos): Replace this set of integer coded as an unsorted
	    array of integers with...
	    (pos_set): this bitset.

	which was implemented long ago, but that I installed only recently
	(March 2019), first published in v3.3.90.

	That patch introduces a bitset to represent a set of integers.  It
	managed negative integers by using a (fixed) base (the smallest
	integer to represent).  It avoided negative accesses into the bitset
	by ignoring integers smaller than the base, under the asumption that
	these cases correspond to useless tokens that are ignored anyway.
	While it turns out to be true for all the test cases in the test suite
	(!), Balázs' use case demonstrates that it is not always the case.

	So we need to be able to accept negative integers that are smaller
	than the current base.

	"Amusingly" enough, the aforementioned patch was visibly unsure about
	itself:

	    /* Store PLACE into POS_SET.  PLACE might not belong to the set
	       of possible values for instance with useless tokens.  It
	       would be more satisfying to eliminate the need for this
	       'if'.  */

	This commit needs several improvements in the future:
	- support from bitset for bit assignment and shifts
	- amortized resizing of pos_set
	- test cases

	* src/tables.c (pos_set_base, pos_set_dump, pos_set_set, pos_set_test):
	New.
	Use them instead of using bitset_set and bitset_test directly.

2021-01-24  Vincent Imbimbo  <vmi6@cornell.edu>

	cex: fix state-item pruning
	There were several bugs in pruning that would leave the state-item
	graph in an inconsistent state which could cause crashes later on:

	- Pruning now happens in one pass instead of two.

	- Disabled state-items no longer prune the state-items they transition
	  to if that state-item has other states that transition to it.

	- State-items that transition to disabled state-items are always
	  pruned even if they have productions.

	Reported by Michal Bartkowiak <michal.bartkowiak@nokia.com>
	https://lists.gnu.org/r/bug-bison/2021-01/msg00000.html
	and Zartaj Majeed
	https://github.com/akimd/bison/issues/71

	* src/state-item.c (prune_forward, prune_backward): Fuse into...
	(prune_state_item): this.
	Adjust callers.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	package: pacify syntax-check
	* cfg.mk: Currently we cannot update gnulib because of portability
	issues with ancient versions of clang
	(https://lists.gnu.org/r/bug-gnulib/2021-01/msg00241.html).  So skip
	the check about copyright date for gnulib.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	news: update

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	package: bump copyrights to 2021
	Run 'make update-copyright'.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	%merge: associate it to its first definition, not the latest
	Currently each time we meet %merge we record this location as the
	defining location (and symbol).  Instead, record the first definition.

	In the generated code we go from

	    yy0->A = merge (*yy0, *yy1);

	to

	    yy0->S = merge (*yy0, *yy1);

	where S was indeed the first symbol, and in the diagnostics we go from

	    glr-regr18.y:30.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
	       30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
	          |                  ^~~~~~~
	    glr-regr18.y:29.18-24: note: previous declaration
	       29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
	          |                  ^~~~~~~
	    glr-regr18.y:31.13-19: error: result type clash on merge function 'merge': <type3> != <type2>
	       31 | sym3: %merge<merge> { $$ = 0; } ;
	          |             ^~~~~~~
	    glr-regr18.y:30.18-24: note: previous declaration
	       30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
	          |                  ^~~~~~~

	to

	    glr-regr18.y:30.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
	       30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
	          |                  ^~~~~~~
	    glr-regr18.y:29.18-24: note: previous declaration
	       29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
	          |                  ^~~~~~~
	    glr-regr18.y:31.13-19: error: result type clash on merge function 'merge': <type3> != <type1>
	       31 | sym3: %merge<merge> { $$ = 0; } ;
	          |             ^~~~~~~
	    glr-regr18.y:29.18-24: note: previous declaration
	       29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
	          |                  ^~~~~~~

	where both duplicates are reported against definition 1, rather than
	using definition 1 as a reference when diagnosing about definition 2,
	and then 2 as a reference for 3.

	* src/reader.c (record_merge_function_type): Keep the first definition.
	* tests/glr-regression.at: Adjust.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	%merge: fix compatibility with api.value.type=union
	Reported by Jot Dot.
	https://lists.gnu.org/r/help-bison/2020-12/msg00014.html

	* data/skeletons/glr.c, data/skeletons/glr2.cc (b4_call_merger): Use
	the symbol's slot, not its type.
	* examples/c/glr/c++-types.y: Use explicit per-symbol typing together
	with api.value.type=union.
	(yylex): Use yytoken_kind_t.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	%merge: delegate the generation of calls to mergers to m4
	Don't generate C code from bison, leave that to the skeletons.

	* src/output.c (merger_output): Emit invocations to b4_call_merger.
	* data/skeletons/glr.c (b4_call_merger): New.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	%merge: let mergers record a typing-symbol, rather than a type
	Symbols are richer than types, and in M4 it is my simpler (and more
	common) to deal with symbols rather than types.  So let's associate
	mergers to a symbol rather than a type name.

	* src/reader.h (merger_list): Replace the 'type' member by a symbol
	member.
	* src/reader.c (record_merge_function_type): Take a symbol as
	argument, rather than a type name.
	* src/output.c (merger_output): Adjust.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	%merge: clearer tests on diagnostics
	* tests/glr-regression.at: Use caret errors.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	skeletons: introduce "slot"s for symbols
	Extracted from d9cf99b6a5cb0345e91dfb90fe6d6473024ea97a, in the master
	branch.

	* data/skeletons/bison.m4 (b4_symbol_slot): New, with safer semantics
	than type and type_tag.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	style: YYUSE is private, make it YY_USE
	This macro is not exposed to users, make start it with 'YY_'.

	* data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/glr.c,
	* data/skeletons/glr.cc, data/skeletons/lalr1.cc,
	* src/parse-gram.c, tests/actions.at, tests/c++.at, tests/headers.at,
	* tests/local.at (YYUSE): Rename as...
	(YY_USE): this.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	package: codespell
	* src/parse-gram.y: Fix spelling.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	cex: fix traces: fix display of disabled items
	The display of disabled state items is incorrect.  The item is
	stuttered, and lacks on end-of-line.

	From

	    State 7:
	        1 exp: exp • "⊕" exp
	        ->     1 exp: exp "⊕" • exp
	        <-     1 exp: • exp "⊕" exp

	        2 exp: exp • "+" exp    2 exp: exp • "+" exp DISABLED
	        2 exp: exp "+" exp •
	        <-     2 exp: exp "+" • exp

	        3 exp: exp • "+" exp    3 exp: exp • "+" exp DISABLED
	        3 exp: exp "+" exp •
	        <-     3 exp: exp "+" • exp

	to

	    State 7:
	        1 exp: exp • "⊕" exp
	        ->     1 exp: exp "⊕" • exp
	        <-     1 exp: • exp "⊕" exp

	        2 exp: exp • "+" exp  DISABLED

	        2 exp: exp "+" exp •
	        <-     2 exp: exp "+" • exp

	        3 exp: exp • "+" exp  DISABLED

	        3 exp: exp "+" exp •
	        <-     3 exp: exp "+" • exp

	* src/state-item.c (state_items_report): Don't issue disabled items
	twice, and issue two '\n' at their end.
	* tests/conflicts.at: Check it.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	cex: fix traces: add missing end-of-lines
	In 430ca0fc632f5e8072fe468b8a99c640985f6926, I completely forgot that
	`puts` adds a `\n`.

	* src/lssi.c, src/state-item.c: Restore missing end-of-lines in the
	output.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	cex: add support for $TIME_LIMIT
	* src/counterexample.c (TIME_LIMIT): Replace with...
	(time_limit): this.
	(counterexample_init): Check $TIME_LIMIT.
	* src/scan-gram.l: Reorder includes.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	cex: send traces to stderr, not stdout
	When comparing traces from different machines, the mixture of
	stdout/stderr in the output are making things uselessly difficult.

	* src/lssi.c, src/state-item.c: Output debug traces on stderr.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	c++: I'm tired of Flex's warnings
	* doc/bison.texi: Disable another warning I'm tired to see.
	New releases would be most welcome.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	glr.cc: don't "leak" yyparse
	When using glr.cc, the C function yyparse is an internal detail that
	should not be exposed.  Users might call it by accident (I did).

	* data/skeletons/glr.c (yyparse): When used for glr.cc, rename as yy_parse_impl.
	* data/skeletons/glr.cc: Adjust.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	tables: avoid warnings and save bits
	The yydefgoto table uses -1 as an invalid for an impossible case (we
	never use yydefgoto[0], since it corresponds to the reduction to
	$accept, which never happens).  Since yydefgoto is a table of state
	numbers, this -1 forces a signed type uselessly, which (1) might
	trigger compiler warnings when storing a value from yydefgoto into a
	state number (nonnegative), and (2) wastes bits which might result in
	using a int16 where a uint8 suffices.

	Reported by Jot Dot <jotdot@shaw.ca>.
	https://lists.gnu.org/r/bug-bison/2020-11/msg00027.html

	* src/tables.c (default_goto): Use 0 rather than -1 as invalid value.
	* tests/regression.at: Adjust.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	c++: use noexcept where appropriate
	Reported by Don Macpherson.
	https://github.com/akimd/bison/issues/63
	https://github.com/akimd/bison/issues/64

	* data/skeletons/c++.m4, data/skeletons/lalr1.cc: here.

2021-01-23  Martin Rehak  <martin.rehak@oracle.com>

	examples: avoid "unbound variable" errors
	When the shell option `nounset` is set, we may get "unbound variable"
	errors.
	https://lists.gnu.org/r/bug-bison/2020-11/msg00013.html

	* examples/test (diff_opts): Be sure to initialize it.

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	autoconf: update

2021-01-23  Akim Demaille  <akim.demaille@gmail.com>

	c: adjust _Noreturn to pedantic clang
	Reported by Joe Nelson <joe@begriffs.com>.
	https://lists.gnu.org/r/help-bison/2021-01/msg00004.html
	Fixed by Paul Eggert in gnulib.
	https://lists.gnu.org/r/bug-gnulib/2021-01/msg00156.html

	* data/skeletons/c.m4 (b4_attribute_define): Adjust _Noreturn to
	pedantic clang.

2021-01-21  Paul Eggert  <eggert@cs.ucla.edu>

	c: port to HP-UX 11.23
	Problem reported by Albert Chin in:
	https://lists.gnu.org/r/bug-bison/2021-01/msg00029.html
	* data/skeletons/c.m4 (b4_c99_int_type_define):
	Work around HP-UX bug.

2020-11-14  Akim Demaille  <akim.demaille@gmail.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

2020-11-14  Akim Demaille  <akim.demaille@gmail.com>

	version 3.7.4
	* NEWS: Record release date.

2020-11-13  Akim Demaille  <akim.demaille@gmail.com>

	c++: shorten the assertions that check whether tokens are correct
	Before:

	    YY_ASSERT (tok == token::YYEOF || tok == token::YYerror || tok == token::YYUNDEF || tok == 120 || tok == 49 || tok == 50 || tok == 51 || tok == 52 || tok == 53 || tok == 54 || tok == 55 || tok == 56 || tok == 57 || tok == 97 || tok == 98);

	After:

	    YY_ASSERT (tok == token::YYEOF
	               || (token::YYerror <= tok && tok <= token::YYUNDEF)
	               || tok == 120
	               || (49 <= tok && tok <= 57)
	               || (97 <= tok && tok <= 98));

	Clauses are now also wrapped on several lines.  This is nicer to read
	and diff, but also avoids pushing Visual C++ to its arbitrary
	limits (640K and lines of 16380 bytes ought to be enough for anybody,
	otherwise make an C2026 error).

	The useless parens are there for the dummy warnings about
	precedence (in the future, will we also have to put parens in
	`1+2*3`?).

	* data/skeletons/variant.hh (_b4_filter_tokens, b4_tok_in, b4_tok_in):
	New.
	(_b4_token_constructor_define): Use them.

2020-11-13  Akim Demaille  <akim.demaille@gmail.com>

	c++: don't glue functions together
	* data/skeletons/bison.m4 (b4_type_foreach): Accept a separator.
	* data/skeletons/c++.m4: Use it.
	And fix an incorrect comment.

2020-11-13  Akim Demaille  <akim.demaille@gmail.com>

	lalr1.cc: YY_ASSERT should use api.prefix
	Working on the previous commit I realized that YY_ASSERT was used in
	the generated headers, so must follow api.prefix to avoid clashes when
	multiple C++ parser with variants are used.

	Actually many more macros should obey api.prefix (YY_CPLUSPLUS,
	YY_COPY, etc.).  There was no complaint so far, so it's not urgent
	enough for 3.7.4, but it should be addressed in 3.8.

	* data/skeletons/variant.hh (b4_assert): New.
	Use it.
	* tests/local.at (AT_YYLEX_RETURN): Fix.
	* tests/headers.at: Make sure variant-based C++ parsers are checked
	too.
	This test did find that YY_ASSERT escaped renaming (before the fix in
	this commit).

2020-11-13  Akim Demaille  <akim.demaille@gmail.com>

	c++: don't use YY_ASSERT at all if parse.assert is disabled
	In some extreme situations (about 800 tokens), we generate a
	single-line assertion long enough for Visual C++ to discard the end of
	the line, thus falling into parse ends for the missing `);`.  On a
	shorter example:

	    YY_ASSERT (tok == token::TOK_YYEOF || tok == token::TOK_YYerror || tok == token::TOK_YYUNDEF || tok == token::TOK_ASSIGN || tok == token::TOK_MINUS || tok == token::TOK_PLUS || tok == token::TOK_STAR || tok == token::TOK_SLASH || tok == token::TOK_LPAREN || tok == token::TOK_RPAREN);

	Whether NDEBUG is used or not is irrelevant, the parser dies anyway.

	Reported by Jot Dot <jotdot@shaw.ca>.
	https://lists.gnu.org/r/bug-bison/2020-11/msg00002.html

	We should avoid emitting lines so long.

	We probably should also use a range-based assertion (with extraneous
	parens to pacify fascist compilers):

	    YY_ASSERT ((token::TOK_YYEOF <= tok && tok <= token::TOK_YYUNDEF)
	               || (token::TOK_ASSIGN <= tok && ...)

	But anyway, we should simply not emit this assertion at all when not
	asked for.

	* data/skeletons/variant.hh: Do not define, nor use, YY_ASSERT when it
	is not enabled.

2020-11-13  Akim Demaille  <akim.demaille@gmail.com>

	c++: style: follow the Bison m4 quoting pattern
	* data/skeletons/variant.hh: here.

2020-11-11  Akim Demaille  <akim.demaille@gmail.com>

	yacc.c: provide the Bison version as an integral macro
	Suggested by Balazs Scheidler.
	https://github.com/akimd/bison/issues/55

	* src/muscle-tab.c (muscle_init): Move/rename `b4_version` to/as...
	* src/output.c (prepare): `b4_version_string`.
	Also define `b4_version`.
	* data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/d.m4,
	* data/skeletons/java.m4: Adjust.
	* doc/bison.texi: Document it.

2020-11-11  Akim Demaille  <akim.demaille@gmail.com>

	regen

2020-11-11  Akim Demaille  <akim.demaille@gmail.com>

	style: make conversion of version string to int public
	* src/parse-gram.y (str_to_version): Rename as/move to...
	* src/strversion.h, src/strversion.c (strversion_to_int): these new
	files.

2020-11-11  Akim Demaille  <akim.demaille@gmail.com>

	%require: accept version numbers with three parts ("3.7.4")
	* src/parse-gram.y (str_to_version): Support three parts.
	* data/skeletons/location.cc, data/skeletons/stack.hh:
	Adjust.

2020-11-11  Todd C. Miller  <Todd.Miller@sudo.ws>

	yacc.c: fix #definition of YYEMPTY
	When generating a C parser, YYEMPTY is present in enum yytokentype but
	there is no corresponding #define like there is for the other values.
	There is a special case for YYEMPTY in b4_token_enums but no
	corresponding case in b4_token_defines.

	* data/skeletons/c.m4 (b4_token_defines): Do define YYEMPTY.

2020-11-10  Akim Demaille  <akim.demaille@gmail.com>

	gnulib: update

2020-11-01  Akim Demaille  <akim.demaille@gmail.com>

	doc: fix incorrect section title
	Reported by Gaurav Singh <gaurav.singh199709@yahoo.com>.
	https://lists.gnu.org/r/bug-bison/2020-11/msg00000.html

	* doc/bison.texi (Rpcalc Expr): Rename as...
	(Rpcalc Exp): this, as the nterm is named 'exp'.

2020-10-28  Nick Gasson  <nick@nickg.me.uk>

	doc: minor grammar fixes in counterexamples section
	* doc/bison.texi: Minor fixes in counterexamples section.

2020-10-14  Akim Demaille  <akim.demaille@gmail.com>

	doc: fix typo
	* README: here.

2020-10-13  Akim Demaille  <akim.demaille@gmail.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

2020-10-13  Akim Demaille  <akim.demaille@gmail.com>

	version 3.7.3
	* NEWS: Record release date.

2020-10-13  Akim Demaille  <akim.demaille@gmail.com>

	build: don't link bison against libreadline
	Reported by Paul Smith <psmith@gnu.org>.
	https://lists.gnu.org/r/bug-bison/2020-10/msg00001.html

	* src/local.mk (src_bison_LDADD): here.

2020-10-13  Akim Demaille  <akim.demaille@gmail.com>

	gnulib: update

2020-09-27  Akim Demaille  <akim.demaille@gmail.com>

	glr.cc: fix: use symbol_name
	* data/skeletons/glr.cc: here.

2020-09-06  Akim Demaille  <akim.demaille@gmail.com>

	build: fix a concurrent build issue in examples
	Reported by Thomas Deutschmann <whissi@gentoo.org>.
	https://lists.gnu.org/r/bug-bison/2020-09/msg00010.html

	* examples/c/lexcalc/local.mk: scan.o depends on parse.[ch].

2020-09-05  Akim Demaille  <akim.demaille@gmail.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

2020-09-05  Akim Demaille  <akim.demaille@gmail.com>

	version 3.7.2
	* NEWS: Record release date.

2020-09-05  Akim Demaille  <akim.demaille@gmail.com>

	build: disable syntax-check warning
	error_message_uppercase
	etc/bench.pl.in-419-static int yylex (@{[is_pure (@directive) ? "YYSTYPE *yylvalp" : "void"]});

	* cfg.mk: here.

2020-09-05  Akim Demaille  <akim.demaille@gmail.com>

	gnulib: update

2020-09-05  Akim Demaille  <akim.demaille@gmail.com>

	build: fix incorrect dependencies
	Commit af000bab111768a04021bf5ffa4bbe91d44e231c ("doc: work around
	Texinfo 6.7 bug"), published in 3.4.91, added a dependency on the
	"all" target.

	This is a super bad idea, since "make all" will run this
	target *before* "all", which builds bison.  It turns out that this new
	dependency actually needed bison to be built.  So all the regular
	process (i) build $(BUILT_SOURCES) and then (ii) build bison, was
	wrecked since some of the $(BUILT_SOURCES) depended on bison...

	It was "easy" to see in the logs of "make V=1" because we were
	building bison files (such as src/files.o) *before* displaying the
	banner for "all-recursive".  With this fix, we finally get again the
	proper sequence:

	    rm -f examples/c/reccalc/scan.stamp examples/c/reccalc/scan.stamp.tmp
	    /opt/local/libexec/gnubin/mkdir -p examples/c/reccalc
	    touch examples/c/reccalc/scan.stamp.tmp
	    flex   -oexamples/c/reccalc/scan.c --header=examples/c/reccalc/scan.h ./examples/c/reccalc/scan.l
	    mv examples/c/reccalc/scan.stamp.tmp examples/c/reccalc/scan.stamp
	    rm -f lib/fcntl.h-t lib/fcntl.h && \
	    { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
	      ...
	    } > lib/fcntl.h-t && \
	    mv lib/fcntl.h-t lib/fcntl.h
	    ...
	    mv -f lib/alloca.h-t lib/alloca.h
	    make  all-recursive

	Reported by Mingli Yu <mingli.yu@windriver.com>.
	https://github.com/akimd/bison/issues/31
	https://lists.gnu.org/r/bison-patches/2020-05/msg00055.html

	Reported by Claudio Calvelli <bugb@w42.org>.
	https://lists.gnu.org/r/bug-bison/2020-09/msg00001.html
	https://bugs.gentoo.org/716516

	* doc/local.mk (all): Rename as...
	(all-local): this.
	So that we don't compete with BUILT_SOURCES.

2020-09-02  Akim Demaille  <akim.demaille@gmail.com>

	doc: updates
	* NEWS, TODO: here.

2020-08-30  Akim Demaille  <akim.demaille@gmail.com>

	gnulib: update

2020-08-30  Akim Demaille  <akim.demaille@gmail.com>

	tests: beware of sed portability issues
	Reported by David Laxer <davidl@softintel.com>.
	https://lists.gnu.org/r/bug-bison/2020-08/msg00027.html

	* tests/output.at: Don't use + with sed.
	While at it, fix a quotation problem hidden by the use of '#'.

2020-08-30  Akim Demaille  <akim.demaille@gmail.com>

	c: always use YYMALLOC/YYFREE
	Reported by Kovalex <kovalex.pro@gmail.com>.
	https://lists.gnu.org/r/bug-bison/2020-08/msg00015.html

	* data/skeletons/yacc.c: Don't make direct calls to malloc/free.
	* tests/calc.at: Check it.

2020-08-30  Akim Demaille  <akim.demaille@gmail.com>

	build: beware of POSIX mode
	Reported by Dennis Clarke.
	https://lists.gnu.org/r/bug-bison/2020-08/msg00013.html

	* examples/d/local.mk, examples/java/calc/local.mk,
	* examples/java/simple/local.mk: Pass bison's options before its
	argument, in case we're in POSIX mode.

2020-08-30  Akim Demaille  <akim.demaille@gmail.com>

	doc: history of api.prefix
	Reported by Matthew Fernandez <matthew.fernandez@gmail.com>.
	https://lists.gnu.org/r/help-bison/2020-08/msg00015.html

	* doc/bison.texi (api.prefix): We move to {} in 3.0.

2020-08-11  Akim Demaille  <akim.demaille@gmail.com>

	CI: intel moved the script for ICC
	* .travis.yml: Adjust.

2020-08-08  Akim Demaille  <akim.demaille@gmail.com>

	fix: unterminated \-escape
	An assertion failed when the last character is a '\' and we're in a
	character or a string.
	Reported by Agency for Defense Development.
	https://lists.gnu.org/r/bug-bison/2020-08/msg00009.html

	* src/scan-gram.l: Catch unterminated escapes.
	* tests/input.at (Unexpected end of file): New.

2020-08-07  Akim Demaille  <akim.demaille@gmail.com>

	fix: crash when redefining the EOF token
	Reported by Agency for Defense Development.
	https://lists.gnu.org/r/bug-bison/2020-08/msg00008.html

	On an empty such as

	    %token FOO
	           BAR
	           FOO 0
	    %%
	    input: %empty

	we crash because when we find FOO 0, we decrement ntokens (since FOO
	was discovered to be EOF, which is already known to be a token, so we
	increment ntokens for it, and need to cancel this).  This "works well"
	when EOF is properly defined in one go, but here it is first defined
	and later only assign token code 0.  In the meanwhile BAR was given
	the token number that we just decremented.

	To fix this, assign symbol numbers after parsing, not during parsing,
	so that we also saw all the explicit token codes.  To maintain the
	current numbers (I'd like to keep no difference in the output, not
	just equivalence), we need to make sure the symbols are numbered in
	the same order: that of appearance in the source file.  So we need the
	locations to be correct, which was almost the case, except for nterms
	that appeared several times as LHS (i.e., several times as "foo:
	...").  Fixing the use of location_of_lhs sufficed (it appears it was
	intended for this use, but its implementation was unfinished: it was
	always set to "false" only).

	* src/symtab.c (symbol_location_as_lhs_set): Update location_of_lhs.
	(symbol_code_set): Remove broken hack that decremented ntokens.
	(symbol_class_set, dummy_symbol_get): Don't set number, ntokens and
	nnterms.
	(symbol_check_defined): Do it.
	(symbols): Don't count nsyms here.
	Actually, don't count nsyms at all: let it be done in...
	* src/reader.c (check_and_convert_grammar): here.  Define nsyms from
	ntokens and nnterms after parsing.
	* tests/input.at (EOF redeclared): New.

	* examples/c/bistromathic/bistromathic.test: Adjust the traces: in
	"%nterm <double> exp %% input: ...", exp used to be numbered before
	input.

2020-08-07  Akim Demaille  <akim.demaille@gmail.com>

	style: fix missing space before paren
	* cfg.mk (_space_before_paren_exempt): Be less laxist.
	* src/output.c, src/reader.c: Fix space before paren issues.
	Pacify the warnings where applicable.

2020-08-07  Akim Demaille  <akim.demaille@gmail.com>

	style: fix comments and more debug trace
	* src/location.c, src/symtab.h, src/symtab.c: here.

2020-08-07  Akim Demaille  <akim.demaille@gmail.com>

	style: more uses of const
	* src/symtab.c: here.

2020-08-07  Akim Demaille  <akim.demaille@gmail.com>

	bench: fix support for pure parser
	* etc/bench.pl.in (is_pure): New.
	(generate_grammar_calc): Use code provides where needed.
	Use is_pure to call yylex properly.
	Coding style fixes.

2020-08-03  Akim Demaille  <akim.demaille@gmail.com>

	portability: multiple typedefs
	Older versions of GCC (4.1.2 here) don't like repeated typedefs.

	      CC       src/bison-parse-simulation.o
	    src/parse-simulation.c:61: error: redefinition of typedef 'parse_state'
	    src/parse-simulation.h:74: error: previous declaration of 'parse_state' was here
	    make: *** [Makefile:7876: src/bison-parse-simulation.o] Error 1

	Reported by Nelson H. F. Beebe.

	* src/parse-simulation.c (parse_state): Don't typedef,
	parse-simulation.h did it already.

2020-08-02  Akim Demaille  <akim.demaille@gmail.com>

	style: revert "avoid warnings with GCC 4.6"
	This reverts commit d0bec3175ff5cf6582ffbf584b73ea6aaea838d0 (which
	should have read "We have a clash...", not "With have a clash...").
	Now that `max()` was renamed `max_int()`, we can use `max` again, as
	elsewhere in the code.

	* src/counterexample.c (visited_hasher): Alpha reconversion.

2020-08-02  Akim Demaille  <akim.demaille@gmail.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

2020-08-02  Akim Demaille  <akim.demaille@gmail.com>

	version 3.7.1
	* NEWS: Record release date.

2020-08-02  Akim Demaille  <akim.demaille@gmail.com>

	portability: we use termios.h and sys/ioctl.h
	Reported by Maarten De Braekeleer.
	https://lists.gnu.org/r/bison-patches/2020-07/msg00079.html

	* bootstrap.conf (gnulib_modules): Add termios and sys_ioctl.

2020-08-02  Maarten De Braekeleer  <maarten.debraekeleer@gmail.com>

	portability: rename accept to acceptsymbol because of MSVC
	MSVC already defines this symbol.

	* src/symtab.h, src/symtab.c (accept): Rename as...
	(acceptsymbol): this.
	Adjust dependencies.

2020-08-02  Akim Demaille  <akim.demaille@gmail.com>

	regen

2020-08-02  Maarten De Braekeleer  <maarten.debraekeleer@gmail.com>

	portability: use CHAR_LITERAL instead of CHAR because MSVC defines CHAR
	* src/parse-gram.y, src/scan-gram.l: here.

2020-08-02  Maarten De Braekeleer  <maarten.debraekeleer@gmail.com>

	portability: use INT_LITERAL instead of INT because MSVC defines INT
	It is defined as a typedef, not a macro.
	https://lists.gnu.org/r/bison-patches/2020-08/msg00001.html

	* src/parse-gram.y, src/scan-gram.l: here.

2020-08-02  Akim Demaille  <akim.demaille@gmail.com>

	portability: beware of max () with MSVC
	Reported by Maarten De Braekeleer.
	https://lists.gnu.org/r/bison-patches/2020-07/msg00080.html

	We don't want to use gnulib's min and max macros, since we use
	function calls in min/max arguments.

	* src/location.c (max_int, min_int): Move to...
	* src/system.h: here.
	* src/counterexample.c, src/derivation.c: Use max_int instead of max.

2020-08-02  Akim Demaille  <akim.demaille@gmail.com>

	libtextstyle: be sure to have ostream_printf and hyperlink support
	Older versions of libtextstyle do not support them, rule them out.

	Reported by Lars Wendler
	https://lists.gnu.org/r/bug-bison/2020-07/msg00030.html

	and by Arnold Robbins
	https://lists.gnu.org/r/bug-bison/2020-07/msg00041.html and
	https://lists.gnu.org/mailman/private/gawk-devel/2020-July/003988.html

	and by Nelson H. F. Beebe
	https://lists.gnu.org/mailman/private/gawk-devel/2020-July/003993.html

	With support from Bruno Haible in gnulib
	https://lists.gnu.org/r/bug-gnulib/2020-08/msg00000.html
	thread starting at
	https://lists.gnu.org/r/bug-gnulib/2020-07/msg00148.html

	* configure.ac: Require libtextstyle 0.20.5.
	* gnulib: Update.

2020-08-01  Akim Demaille  <akim.demaille@gmail.com>

	CI: comment changes

2020-08-01  Akim Demaille  <akim.demaille@gmail.com>

	regen

2020-08-01  Akim Demaille  <akim.demaille@gmail.com>

	diagnostics: better location for type redeclarations
	From

	    foo.y:1.7-11: error: %type redeclaration for bar
	        1 | %type <foo> bar bar
	          |       ^~~~~
	    foo.y:1.7-11: note: previous declaration
	        1 | %type <foo> bar bar
	          |       ^~~~~

	to

	    foo.y:1.17-19: error: %type redeclaration for bar
	        1 | %type <foo> bar bar
	          |                 ^~~
	    foo.y:1.13-15: note: previous declaration
	        1 | %type <foo> bar bar
	          |             ^~~

	* src/symlist.h, src/symlist.c (symbol_list_type_set): There's no need
	for the tag's location, use that of the symbol.
	* src/parse-gram.y: Adjust.
	* tests/input.at: Adjust.

2020-07-30  Akim Demaille  <akim.demaille@gmail.com>

	todo: updates for D

2020-07-29  Akim Demaille  <akim.demaille@gmail.com>

	cex: style: comment changes
	* src/parse-simulation.c: here.

2020-07-29  Akim Demaille  <akim.demaille@gmail.com>

	cex: style: prefer "res" for the returned value
	* src/derivation.c (derivation_new): here.

2020-07-29  Akim Demaille  <akim.demaille@gmail.com>

	cex: style: prefer FOO_print to print_FOO
	* src/state-item.h, src/state-item.c (print_state_item): Rename as...
	(state_item_print): this.
	* src/counterexample.c (print_counterexample): Rename as...
	(counterexample_print): this.

2020-07-28  Akim Demaille  <akim.demaille@gmail.com>

	scanner: don't crash on strings containing a NUL byte
	We crash if the input contains a string containing a NUL byte.
	Reported by Suhwan Song.
	https://lists.gnu.org/r/bug-bison/2020-07/msg00051.html

	* src/flex-scanner.h (STRING_FREE): Avoid accidental use of
	last_string.
	* src/scan-gram.l: Don't call STRING_FREE without calling
	STRING_FINISH first.
	* tests/input.at (Invalid inputs): Check that case.

2020-07-28  Akim Demaille  <akim.demaille@gmail.com>

	doc: refer to cex from sections dealing with conflicts
	The documentation about -Wcex should be put forward.

	* doc/bison.texi: Refer to -Wcex from the sections about conflicts.

2020-07-28  Akim Demaille  <akim.demaille@gmail.com>

	doc: factor ifnottex/iftex examples
	* doc/bison.texi: Factor the common bits out of ifnottex/iftex.

2020-07-28  Akim Demaille  <akim.demaille@gmail.com>

	doc: fix colors
	The original Texinfo macros introducing colors were made for
	diagnostics, which are printed in bold.  So by copy-paste accident the
	styles we introduced for counterexamples were also in bold.  They
	should not.

	* doc/bison.texi: Separate the styling of diagnostics from the styling
	for counterexamples.
	Don't use bold in the latter case.

2020-07-28  Akim Demaille  <akim.demaille@gmail.com>

	doc: fixes
	* doc/bison.texi: Fix spello.
	Fix missing colors, and factor.

2020-07-23  Akim Demaille  <akim.demaille@gmail.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

2020-07-23  Akim Demaille  <akim.demaille@gmail.com>

	version 3.7
	* NEWS: Record release date.

2020-07-23  Akim Demaille  <akim.demaille@gmail.com>

	style: avoid warnings with GCC 4.6
	With have a clash with the "max" function.

	    src/counterexample.c: In function 'visited_hasher':
	    src/counterexample.c:720:48: error: declaration of 'max' shadows a global declaration [-Werror=shadow]
	    src/counterexample.c:116:12: error: shadowed declaration is here [-Werror=shadow]

	* src/counterexample.c (visited_hasher): Alpha conversion.

2020-07-23  Akim Demaille  <akim.demaille@gmail.com>

	doc: fix definition of -Wall
	* doc/bison.texi (Diagnostics): here.

