]> git.saurik.com Git - bison.git/blobdiff - src/location.h
(gram_error): Remove decl.
[bison.git] / src / location.h
index 7e8fe61eec75bb4470167f3783e3c7c2e665299a..5a2d64a30170ab9dc9f7c7d8baf85d53af006928 100644 (file)
@@ -49,23 +49,27 @@ do {                                                \
 } while (0)
 
 
-/* Output LOC on the stream OUT. */
+/* Output LOC on the stream OUT.
+   Warning: it uses quotearg's slot 3.  */
 # define LOCATION_PRINT(Out, Loc)                                      \
 do {                                                                   \
-  fprintf (stderr, "%s:", quotearg_style (escape_quoting_style,        \
-                                         (Loc).file));                 \
-  if ((Loc).first_line != (Loc).last_line)                             \
-    fprintf (Out, "%d.%d-%d.%d",                                       \
-             (Loc).first_line, (Loc).first_column,                     \
-             (Loc).last_line, (Loc).last_column - 1);                  \
-  else if ((Loc).first_column < (Loc).last_column - 1)                 \
-    fprintf (Out, "%d.%d-%d", (Loc).first_line,                                \
-             (Loc).first_column, (Loc).last_column - 1);               \
-  else                                                                 \
-    fprintf (Out, "%d.%d", (Loc).first_line, (Loc).first_column);      \
+  fprintf (stderr, "%s:", quotearg_n_style (3, escape_quoting_style,   \
+                                           (Loc).file));               \
+  if ((Loc).first_line)                                                        \
+    {                                                                  \
+      if ((Loc).first_line != (Loc).last_line)                         \
+       fprintf (Out, "%d.%d-%d.%d",                                    \
+                (Loc).first_line, (Loc).first_column,                  \
+                (Loc).last_line, (Loc).last_column - 1);               \
+      else if ((Loc).first_column < (Loc).last_column - 1)             \
+       fprintf (Out, "%d.%d-%d", (Loc).first_line,                     \
+                (Loc).first_column, (Loc).last_column - 1);            \
+      else                                                             \
+       fprintf (Out, "%d.%d", (Loc).first_line, (Loc).first_column);   \
+  }                                                                    \
 } while (0)
 
 
-
 extern location_t empty_location;
+
 #endif /* !LOCATION_H_ */