]> git.saurik.com Git - bison.git/blobdiff - src/gram.c
grammar: warn about unused precedence for symbols
[bison.git] / src / gram.c
index 20aefe19c48f32e0242f47de740e91db7ad403b9..6cbe622ba70af826ccd4d262d86586ef904b6482 100644 (file)
@@ -1,6 +1,6 @@
 /* Allocate input grammar variables for Bison.
 
-   Copyright (C) 1984, 1986, 1989, 2001-2003, 2005-2012 Free Software
+   Copyright (C) 1984, 1986, 1989, 2001-2003, 2005-2013 Free Software
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -69,16 +69,9 @@ rule_lhs_print (rule const *r, symbol const *previous_lhs, FILE *out)
 {
   fprintf (out, "  %3d ", r->number);
   if (previous_lhs != r->lhs)
-    {
-      fprintf (out, "%s:", r->lhs->tag);
-    }
+    fprintf (out, "%s:", r->lhs->tag);
   else
-    {
-      int n;
-      for (n = strlen (previous_lhs->tag); n > 0; --n)
-        fputc (' ', out);
-      fputc ('|', out);
-    }
+    fprintf (out, "%*s|", (int) strlen (previous_lhs->tag), "");
 }
 
 void