bison-patches
[Top][All Lists]
Advanced

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

[PATCH 5/6] syncline: one line is enough


From: Akim Demaille
Subject: [PATCH 5/6] syncline: one line is enough
Date: Fri, 28 Dec 2012 11:41:07 +0100

So far we were issuing two lines for each syncline change:

  /* Line 356 of yacc.c  */
  #line 1 "src/parse-gram.y"

This is a lot of clutter, especially when reading diffs, as these
lines change often.  Fuse them into a single, shorter, line:

  #line 1 "src/parse-gram.y" /* yacc.c:356  */

* data/bison.m4 (b4_syncline): Issue a single line.
Comment improvements.
(b4_sync_start, b4_sync_end): Issue a shorter comment.
* data/c++.m4 (b4_semantic_type_declare): b4_user_code must be
on its own line as it might start with a "#line" directive.
---
 data/bison.m4 | 18 ++++++++++++++----
 data/c++.m4   |  3 ++-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/data/bison.m4 b/data/bison.m4
index 5189a8b..75aa305 100644
--- a/data/bison.m4
+++ b/data/bison.m4
@@ -541,11 +541,21 @@ m4_define([b4_basename],
 # -----------------------
 m4_define([b4_syncline],
 [b4_flag_if([synclines],
-[b4_sync_end([__line__], [b4_basename(m4_quote(__file__))])
-b4_sync_start([$1], [$2])])])
+[b4_sync_start([$1], [$2]) b4_sync_end([__line__],
+                                       [b4_basename(m4_quote(__file__))])[]dnl
+])])
+
+# b4_sync_start(LINE, FILE)
+# -----------------------
+# Syncline for the new place.  Typically a directive for the compiler.
+m4_define([b4_sync_start], [b4_comment([$2:$1])])
+
+# b4_sync_end(LINE, FILE)
+# -----------------------
+# Syncline for the current place, which ends.  Typically a comment
+# left for the reader.
+m4_define([b4_sync_end],   [b4_comment([$2:$1])])
 
-m4_define([b4_sync_end], [b4_comment([Line $1 of $2])])
-m4_define([b4_sync_start], [b4_comment([Line $1 of $2])])
 
 # b4_user_code(USER-CODE)
 # -----------------------
diff --git a/data/c++.m4 b/data/c++.m4
index b0e2e70..dd051e1 100644
--- a/data/c++.m4
+++ b/data/c++.m4
@@ -119,7 +119,8 @@ m4_define([b4_semantic_type_declare],
 [    /// Symbol semantic values.
 m4_ifdef([b4_stype],
 [    union semantic_type
-    {b4_user_stype
+    {
+b4_user_stype
     };],
 [m4_if(b4_tag_seen_flag, 0,
 [[    typedef int semantic_type;]],
-- 
1.8.0.2




reply via email to

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