* src/reader.c (readgram): Make sure rules for mid-rule actions

have a lineno equal to that of their host rule.
Reported by Hans Aberg.
* tests/regression.at (Rule Line Numbers): New.
This commit is contained in:
Akim Demaille
2001-11-26 15:24:06 +00:00
parent 6fedd4d1d6
commit 674fd9acbc
12 changed files with 379 additions and 228 deletions

View File

@@ -1438,12 +1438,14 @@ readgram (void)
/* Make a dummy nonterminal, a gensym. */
bucket *sdummy = gensym ();
/* Make a new rule, whose body is empty,
before the current one, so that the action
just read can belong to it. */
/* Make a new rule, whose body is empty, before the
current one, so that the action just read can
belong to it. */
nrules++;
nitems++;
p = symbol_list_new (sdummy);
/* Attach its lineno to that of the host rule. */
p->line = crule->line;
if (crule1)
crule1->next = p;
else