summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2002-12-24 08:08:18 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2002-12-24 08:08:18 +0000
commit5320ca4d6fe045c2e4deb6f46f901264cd4d0351 (patch)
treef80f96462c98411e634ffc0462b3bc8f17ebd10a
parent33167b8b054107d0fd2fe1e51e2e52079d6856ba (diff)
downloadbison-5320ca4d6fe045c2e4deb6f46f901264cd4d0351.tar.gz
(lloc_default): Remove test for empty
nonterminals at the end, since it didn't change the result.
-rw-r--r--src/parse-gram.y10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/parse-gram.y b/src/parse-gram.y
index 2224c85f..e8863018 100644
--- a/src/parse-gram.y
+++ b/src/parse-gram.y
@@ -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;
}