* 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:27:58 +00:00
parent 0e41b407b9
commit 2ca209c11d
3 changed files with 154 additions and 3 deletions

View File

@@ -1474,12 +1474,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