bison-patches
[Top][All Lists]
Advanced

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

06-fyi-useful-token.patch


From: Akim Demaille
Subject: 06-fyi-useful-token.patch
Date: Sun, 07 Apr 2002 17:23:15 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
        lacking `+ 1' to nrules, Bison reported as useless a token if it
        was used solely to set the precedence of the last rule...
        
        
Index: NEWS
--- NEWS Sat, 16 Mar 2002 13:01:57 +0100 akim
+++ NEWS Sat, 23 Mar 2002 16:32:57 +0100 akim
@@ -3,6 +3,16 @@
 
 Changes in version 1.49a:
 
+* False `Token not used' report fixed.
+  On a grammar such as
+
+           %token useless useful
+           %%
+           exp: '0' %prec useful;
+
+  where a token was used to set the precedence of the last rule,
+  bison reported both `useful' and `useless' as useless tokens.
+
 * Revert the C++ namespace changes introduced in 1.31, as they caused too
   many portability hassles.
 
Index: src/reduce.c
--- src/reduce.c Sat, 23 Mar 2002 13:51:12 +0100 akim
+++ src/reduce.c Sat, 23 Mar 2002 16:30:30 +0100 akim
@@ -215,7 +215,7 @@
   nuseless_nonterminals = nvars - nuseful_nonterminals;
 
   /* A token that was used in %prec should not be warned about.  */
-  for (i = 1; i < nrules; i++)
+  for (i = 1; i < nrules + 1; i++)
     if (rules[i].precsym != 0)
       bitset_set (V1, rules[i].precsym);
 }



reply via email to

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