bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

minor code cleanup in empty-nonterminal location code


From: Paul Eggert
Subject: minor code cleanup in empty-nonterminal location code
Date: Tue, 24 Dec 2002 00:10:17 -0800 (PST)

I installed this:

2002-12-24  Paul Eggert  <address@hidden>

        * src/parse-gram.y (lloc_default): Remove test for empty
        nonterminals at the end, since it didn't change the result.

Index: parse-gram.y
===================================================================
RCS file: /cvsroot/bison/bison/src/parse-gram.y,v
retrieving revision 1.36
retrieving revision 1.37
diff -p -u -r1.36 -r1.37
--- parse-gram.y        24 Dec 2002 07:44:40 -0000      1.36
+++ parse-gram.y        24 Dec 2002 08:08:18 -0000      1.37
@@ -413,20 +413,16 @@ static YYLTYPE
 lloc_default (YYLTYPE const *rhs, int n)
 {
   int i;
-  int j;
   YYLTYPE r;
   r.start = r.end = rhs[n].end;
 
+  /* Ignore empty nonterminals the start of the the right-hand side.
+     Do not bother to ignore them at the end of the right-hand side,
+     since empty nonterminals have the same end as their predecessors.  */
   for (i = 1; i <= n; i++)
     if (! equal_boundaries (rhs[i].start, rhs[i].end))
       {
        r.start = rhs[i].start;
-
-       for (j = n; i < j; j--)
-         if (! equal_boundaries (rhs[j].start, rhs[j].end))
-           break;
-       r.end = rhs[j].end;
-
        break;
       }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]