]> git.saurik.com Git - bison.git/blobdiff - src/reader.c
* src/reader.c (readgram): Make sure rules for mid-rule actions
[bison.git] / src / reader.c
index 8f01a7c4ae49678991d211b710799a335f0f8eff..73e79704a6024fcacda7a22a7c928d1550c3b6cd 100644 (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