mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 14:53:03 +00:00
Update to the current gnulib CVS repository, and fix trigraph handling
in Bison. * bootstrap: Update gnulib CVS repository URL. (symlink_to_dir): Encapsulate the code that guarantees the destination directory exists into... (check_dst_dir): ... this new function, and... (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't fail when copying files into lib/uniwidth/. * src/output.c (prepare_symbols): When writing yytname muscles, where symbol names will be encoded in C-string literals, tell quotearg to escape trigraphs. This used to be the default in gnulib. * tests/regression.at (Token definitions): Because of the change in gnulib's quotearg behavior, string_as_id in parse-gram.y no longer escapes trigraphs in symbol names. Thus, yytname no longer has trigraphs unnecessarily doubly escaped. Update test case output. Extend test case to be sure Bison's own error messages will no longer have trigraphs in symbol names unnecessarily escaped once.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/* Output the generated parsing program for Bison.
|
||||
|
||||
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004,
|
||||
2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -156,9 +156,12 @@ prepare_symbols (void)
|
||||
int i;
|
||||
/* We assume that the table will be output starting at column 2. */
|
||||
int j = 2;
|
||||
struct quoting_options *qo = clone_quoting_options (0);
|
||||
set_quoting_style (qo, c_quoting_style);
|
||||
set_quoting_flags (qo, QA_SPLIT_TRIGRAPHS);
|
||||
for (i = 0; i < nsyms; i++)
|
||||
{
|
||||
char const *cp = quotearg_style (c_quoting_style, symbols[i]->tag);
|
||||
char *cp = quotearg_alloc (symbols[i]->tag, -1, qo);
|
||||
/* Width of the next token, including the two quotes, the
|
||||
comma and the space. */
|
||||
int width = strlen (cp) + 2;
|
||||
@@ -172,9 +175,11 @@ prepare_symbols (void)
|
||||
if (i)
|
||||
obstack_1grow (&format_obstack, ' ');
|
||||
MUSCLE_OBSTACK_SGROW (&format_obstack, cp);
|
||||
free (cp);
|
||||
obstack_1grow (&format_obstack, ',');
|
||||
j += width;
|
||||
}
|
||||
free (qo);
|
||||
obstack_sgrow (&format_obstack, " ]b4_null[");
|
||||
|
||||
/* Finish table and store. */
|
||||
|
||||
Reference in New Issue
Block a user