Restore --no-lines.

Reported by Jim Kent.
* data/c.m4 (b4_syncline): New.
* data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
* src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
* src/output.c (user_actions_output): Likewise.
(prepare): Define 'b4_synclines_flag'.
This commit is contained in:
Akim Demaille
2002-11-06 14:11:47 +00:00
parent 900c5db537
commit 437c2d8000
11 changed files with 58 additions and 56 deletions

View File

@@ -276,11 +276,10 @@ user_actions_output (FILE *out)
{
fprintf (out, " case %d:\n", r + 1);
if (!no_lines_flag)
fprintf (out, muscle_find ("linef"),
rules[r].action_location.first_line,
quotearg_style (c_quoting_style,
rules[r].action_location.file));
fprintf (out, "]b4_syncline([[%d]], [[%s]])[\n",
rules[r].action_location.first_line,
quotearg_style (escape_quoting_style,
rules[r].action_location.file));
fprintf (out, " %s\n break;\n\n",
rules[r].action);
}
@@ -566,11 +565,12 @@ static void
prepare (void)
{
/* Flags. */
MUSCLE_INSERT_INT ("locations_flag", locations_flag);
MUSCLE_INSERT_INT ("debug", debug_flag);
MUSCLE_INSERT_INT ("defines_flag", defines_flag);
MUSCLE_INSERT_INT ("error_verbose", error_verbose);
MUSCLE_INSERT_INT ("locations_flag", locations_flag);
MUSCLE_INSERT_INT ("pure", pure_parser);
MUSCLE_INSERT_INT ("debug", debug_flag);
MUSCLE_INSERT_INT ("synclines_flag", !no_lines_flag);
/* FIXME: This is wrong: the muscles should decide whether they hold
a copy or not, but the situation is too obscure currently. */