From b526ee6116d3a769d1af313163ad4eaa910b1037 Mon Sep 17 00:00:00 2001
From: Akim Demaille <akim@epita.fr>
Date: Thu, 24 Oct 2002 11:40:27 +0000
Subject: [PATCH] * src/output.c (output_skeleton): Don't disable M4sugar
 comments too soon: it results in comments being expanded. * data/yacc.c,
 data/glr.c, data/lalr1.cc: Do it right before the first output.

---
 ChangeLog     | 7 +++++++
 data/glr.c    | 2 ++
 data/lalr1.cc | 2 ++
 data/yacc.c   | 3 ++-
 src/output.c  | 4 ----
 5 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cc9da645..b31ebd37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-10-24  Akim Demaille  <akim@epita.fr>
+
+	* src/output.c (output_skeleton): Don't disable M4sugar comments
+	too soon: it results in comments being expanded.
+	* data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
+	first output.
+
 2002-10-24  Akim Demaille  <akim@epita.fr>
 
 	* data/yacc.c (m4_int_type): New.
diff --git a/data/glr.c b/data/glr.c
index 77a35afc..4d34e5f3 100644
--- a/data/glr.c
+++ b/data/glr.c
@@ -111,6 +111,8 @@ m4_define_default([b4_header_guard],
                                 [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])])
 
 
+# We do want M4 expansion after # for CPP macros.
+m4_changecom()
 m4_divert(0)dnl
 #output "b4_output_parser_name"
 b4_copyright([Skeleton parser for GLR parsing with Bison], [2002])
diff --git a/data/lalr1.cc b/data/lalr1.cc
index b7b64c3c..8f3ebad8 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -105,6 +105,8 @@ m4_define([b4_constructor],
 		    [])])
 
 
+# We do want M4 expansion after # for CPP macros.
+m4_changecom()
 m4_divert(0)dnl
 #output "b4_output_header_name"
 b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
diff --git a/data/yacc.c b/data/yacc.c
index 11edba30..0bbd4827 100644
--- a/data/yacc.c
+++ b/data/yacc.c
@@ -156,7 +156,8 @@ m4_popdef([b4_dollar_dollar])dnl
 ])
 
 
-
+# We do want M4 expansion after # for CPP macros.
+m4_changecom()
 m4_divert(0)dnl
 #output "b4_output_parser_name"
 b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
diff --git a/src/output.c b/src/output.c
index 1edf854f..6395d6db 100644
--- a/src/output.c
+++ b/src/output.c
@@ -527,10 +527,6 @@ output_skeleton (void)
     error (EXIT_FAILURE, errno, "fdopen");
 
   /* Output the definitions of all the muscles.  */
-
-  /* There are no comments, especially not `#': we do want M4 expansion
-     after `#': think of CPP macros!  */
-  fputs ("m4_changecom()\n", out);
   fputs ("m4_init()\n", out);
 
   user_actions_output (out);
-- 
2.47.2