X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/6e30ede87a1c39c53842a6a747ecd9f7484d92a5..5422d56a718805a2470558808355e04182a12d65:/src/symtab.c diff --git a/src/symtab.c b/src/symtab.c index b9eca195..f065c80d 100644 --- a/src/symtab.c +++ b/src/symtab.c @@ -1,7 +1,7 @@ /* Symbol table manager for Bison. - Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004, 2005, 2006, 2007, - 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 2000-2002, 2004-2011 Free Software + Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -68,7 +68,7 @@ symbol_new (uniqstr tag, location loc) /* If the tag is not a string (starts with a double quote), check that it is valid for Yacc. */ - if (tag[0] != '\"' && tag[0] != '\'' && strchr (tag, '-')) + if (tag[0] != '\"' && tag[0] != '\'' && mbschr (tag, '-')) yacc_at (loc, _("POSIX Yacc forbids dashes in symbol names: %s"), tag); @@ -368,10 +368,11 @@ symbol_user_token_number_set (symbol *sym, int user_token_number, location loc) if (user_token_number == 0) { endtoken = sym; - endtoken->number = 0; /* It is always mapped to 0, so it was already counted in NTOKENS. */ - --ntokens; + if (endtoken->number != NUMBER_UNDEFINED) + --ntokens; + endtoken->number = 0; } }