-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
+# define YY_LOCATION_PRINT(File, Loc) \
+ do { \
+ fprintf (File, "%d.%d", (Loc).first_line, (Loc).first_column); \
+ if ((Loc).first_line < (Loc).last_line) \
+ fprintf (File, "-%d.%d", (Loc).last_line, (Loc).last_column - 1); \
+ else if ((Loc).first_column < (Loc).last_column - 1) \
+ fprintf (File, "-%d", (Loc).last_column - 1); \
+ } while (0)