mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
* 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user