deterministic user-token-number redeclaration errors.

Address nondeterminism reported by Joel E. Denny.
http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html

	* src/uniqstr.h: Comment changes.
	* src/location.h (boundary_cmp, location_cmp): New.
	* src/symtab.c (user_token_number_redeclaration): New.
	(symbol_translation): Use it.
	* tests/input.at (Numbered tokens): Adjust the expected output.
This commit is contained in:
Akim Demaille
2009-06-03 23:15:38 +02:00
parent 796a2b0ab0
commit 12cf133f34
5 changed files with 67 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
/* Keeping a unique copy of strings.
Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2008, 2009 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -32,8 +32,8 @@ uniqstr uniqstr_new (char const *str);
/* Two uniqstr values have the same value iff they are the same. */
#define UNIQSTR_EQ(USTR1, USTR2) ((USTR1) == (USTR2))
/* Compare two uniqstr a la strlen: negative for <, nul for =, and
positive for >. */
/* Compare two uniqstr a la strcmp: negative for <, nul for =, and
positive for >. Undefined order, relies on addresses. */
#define UNIQSTR_CMP(USTR1, USTR2) ((USTR1) - (USTR2))
/*--------------------------------------.