mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +00:00
* src/output.c (prepare_symbols): Avoid trailing spaces in the
output.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2003-03-31 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/output.c (prepare_symbols): Avoid trailing spaces in the
|
||||||
|
output.
|
||||||
|
|
||||||
2003-03-31 Akim Demaille <akim@epita.fr>
|
2003-03-31 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
|
* doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
|
||||||
|
|||||||
23
src/output.c
23
src/output.c
@@ -159,31 +159,30 @@ prepare_symbols (void)
|
|||||||
/* tname -- token names. */
|
/* tname -- token names. */
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int j = 0;
|
/* We assume that the table will be output starting at column 2. */
|
||||||
|
int j = 2;
|
||||||
for (i = 0; i < nsyms; i++)
|
for (i = 0; i < nsyms; i++)
|
||||||
{
|
{
|
||||||
/* Be sure not to use twice the same QUOTEARG slot:
|
const char *cp = quotearg_style (c_quoting_style, symbols[i]->tag);
|
||||||
SYMBOL_TAG_GET uses slot 0. */
|
/* Width of the next token, including the two quotes, the
|
||||||
const char *cp =
|
comma and the space. */
|
||||||
quotearg_n_style (1, c_quoting_style,
|
|
||||||
symbols[i]->tag);
|
|
||||||
/* Width of the next token, including the two quotes, the comma
|
|
||||||
and the space. */
|
|
||||||
int width = strlen (cp) + 2;
|
int width = strlen (cp) + 2;
|
||||||
|
|
||||||
if (j + width > 75)
|
if (j + width > 75)
|
||||||
{
|
{
|
||||||
obstack_sgrow (&format_obstack, "\n ");
|
obstack_sgrow (&format_obstack, "\n ");
|
||||||
j = 2;
|
j = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i)
|
||||||
|
obstack_1grow (&format_obstack, ' ');
|
||||||
MUSCLE_OBSTACK_SGROW (&format_obstack, cp);
|
MUSCLE_OBSTACK_SGROW (&format_obstack, cp);
|
||||||
obstack_sgrow (&format_obstack, ", ");
|
obstack_1grow (&format_obstack, ',');
|
||||||
j += width;
|
j += width;
|
||||||
}
|
}
|
||||||
/* Add a NULL entry to list of tokens (well, 0, as NULL might not be
|
/* Add a NULL entry to list of tokens (well, 0, as NULL might not be
|
||||||
defined). */
|
defined). */
|
||||||
obstack_sgrow (&format_obstack, "0");
|
obstack_sgrow (&format_obstack, " 0");
|
||||||
|
|
||||||
/* Finish table and store. */
|
/* Finish table and store. */
|
||||||
obstack_1grow (&format_obstack, 0);
|
obstack_1grow (&format_obstack, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user