]> git.saurik.com Git - bison.git/blobdiff - src/conflicts.c
muscle: factor the computation of variable names
[bison.git] / src / conflicts.c
index 885bd78f2154f07a08e1ffad36ca68aee02170f2..184047362064d6da09eef800c6eff2967abaf034 100644 (file)
@@ -276,11 +276,13 @@ resolve_sr_conflict (state *s, int ruleno, symbol **errors, int *nerrs)
            The precedence of shifting is that of token i.  */
         if (symbols[i]->prec < redprec)
           {
+            register_precedence (redrule->prec->number, i);
             log_resolution (redrule, i, reduce_resolution);
             flush_shift (s, i);
           }
         else if (symbols[i]->prec > redprec)
           {
+            register_precedence (i, redrule->prec->number);
             log_resolution (redrule, i, shift_resolution);
             flush_reduce (lookahead_tokens, i);
           }
@@ -301,16 +303,19 @@ resolve_sr_conflict (state *s, int ruleno, symbol **errors, int *nerrs)
               break;
 
             case right_assoc:
+              register_assoc (i, redrule->prec->number);
               log_resolution (redrule, i, right_resolution);
               flush_reduce (lookahead_tokens, i);
               break;
 
             case left_assoc:
+              register_assoc (i, redrule->prec->number);
               log_resolution (redrule, i, left_resolution);
               flush_shift (s, i);
               break;
 
             case non_assoc:
+              register_assoc (i, redrule->prec->number);
               log_resolution (redrule, i, nonassoc_resolution);
               flush_shift (s, i);
               flush_reduce (lookahead_tokens, i);
@@ -398,7 +403,7 @@ conflicts_solve (void)
       set_conflicts (states[i], errors);
 
       /* For uniformity of the code, make sure all the states have a valid
-         `errs' member.  */
+         'errs' member.  */
       if (!states[i]->errs)
         states[i]->errs = errs_new (0, 0);
     }