bison-patches
[Top][All Lists]
Advanced

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

[PATCH] Avoid trailing spaces.


From: Akim Demaille
Subject: [PATCH] Avoid trailing spaces.
Date: Mon, 10 Nov 2008 10:51:02 -0000

        * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
        * data/lalr1.cc: Don't indent before rule and symbol actions, as
        they can be empty, and anyway this incorrectly indents the first
        action.
---
 ChangeLog     |    8 ++++++++
 data/c.m4     |    7 +++++--
 data/lalr1.cc |    6 +++---
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ed87b06..e3c3e0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2008-11-10  Akim Demaille  <address@hidden>
 
+       Avoid trailing spaces.
+       * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
+       * data/lalr1.cc: Don't indent before rule and symbol actions, as
+       they can be empty, and anyway this incorrectly indents the first
+       action.
+
+2008-11-10  Akim Demaille  <address@hidden>
+
        Comment changes.
 
 2008-11-10  Akim Demaille  <address@hidden>
diff --git a/data/c.m4 b/data/c.m4
index 46ced82..430a557 100644
--- a/data/c.m4
+++ b/data/c.m4
@@ -23,9 +23,12 @@
 
 # b4_comment(TEXT)
 # ----------------
+# Put TEXT in comment.  Avoid trailing spaces: don't indent empty lines.
+# Avoid adding indentation to the first line, as the indentation comes
+# from "/*".  That's why we don't patsubst([$1], [^\(.\)], [   \1]).
 m4_define([b4_comment], [/* m4_bpatsubst([$1], [
-], [
-   ])  */])
+\(.\)], [
+   \1])  */])
 
 # b4_identification
 # -----------------
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 578e24f..c543343 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -884,8 +884,8 @@ b4_percent_code_get[]dnl
         << yysym.location << ": ";
     switch (yytype)
       {
-]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
-[       default:
+]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))[
+       default:
          break;
       }
     yyo << ')';
@@ -1105,7 +1105,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
     YY_REDUCE_PRINT (yyn);
     switch (yyn)
       {
-       ]b4_user_actions[
+]b4_user_actions[
        default:
           break;
       }
-- 
1.6.0.2.588.g3102





reply via email to

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