bison-patches
[Top][All Lists]
Advanced

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

FYI: [MAIN] lines-output.patch


From: marc-alexandre autret
Subject: FYI: [MAIN] lines-output.patch
Date: Fri, 21 Sep 2001 18:21:16 +0000 (GMT)

Hi,


Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.216
diff -u -r1.216 ChangeLog
--- ChangeLog   2001/09/21 15:42:26     1.216
+++ ChangeLog   2001/09/21 15:59:28
@@ -1,5 +1,13 @@
 2001-09-21  Marc Autret  <address@hidden>
 
+       * src/reader.c (copy_definition, parse_union_decl): Update and use
+       `linef' muscle.
+       (copy_action): Likewise.
+       Use obstack_1grow ().
+       * src/muscle_tab.c (muscle_init): Add muscle `linef'.
+
+2001-09-21  Marc Autret  <address@hidden>
+
        * src/options.c (option_table): Adjust.
        * src/lex.c (parse_percent_token): Fix.
 
Index: src/muscle_tab.c
===================================================================
RCS file: /cvsroot/bison/bison/src/muscle_tab.c,v
retrieving revision 1.2
diff -u -r1.2 muscle_tab.c
--- src/muscle_tab.c    2001/09/19 19:25:02     1.2
+++ src/muscle_tab.c    2001/09/21 15:59:28
@@ -91,6 +91,8 @@
   muscle_insert ("ntbase", "0");
   muscle_insert ("verbose", "0");
   muscle_insert ("prefix", "yy");
+  /* Default #line formatting.  */
+  muscle_insert ("linef", "#line %d %s\n");
 
   /* No parser macros.  */
   muscle_insert ("nnts", "0");
Index: src/reader.c
===================================================================
RCS file: /cvsroot/bison/bison/src/reader.c,v
retrieving revision 1.87
diff -u -r1.87 reader.c
--- src/reader.c        2001/09/20 18:32:20     1.87
+++ src/reader.c        2001/09/21 15:59:29
@@ -429,8 +429,11 @@
 
 #if 0
   if (!no_lines_flag)
-    obstack_fgrow2 (&attrs_obstack, "#line %d %s\n",
-                   lineno, quotearg_style (c_quoting_style, infile));
+    {
+      obstack_fgrow2 (&attrs_obstack, muscle_find ("linef"),
+                     lineno, quotearg_style (c_quoting_style, 
+                                             muscle_find("filename")));
+    }
 #endif
 
   after_percent = 0;
@@ -748,13 +751,16 @@
 
   typed = 1;
 
+
   if (!no_lines_flag)
-    obstack_fgrow2 (&attrs_obstack, "\n#line %d %s\n",
-                   lineno, quotearg_style (c_quoting_style, 
-                                           muscle_find("filename")));
+    {
+      obstack_fgrow2 (&attrs_obstack, muscle_find ("linef"),
+                     lineno, quotearg_style (c_quoting_style, 
+                                             muscle_find("filename")));
+    }
   else
     obstack_1grow (&attrs_obstack, '\n');
-
+  
   obstack_sgrow (&attrs_obstack, "typedef union");
   if (defines_flag)
     obstack_sgrow (&defines_obstack, "typedef union");
@@ -1107,15 +1113,13 @@
   if (semantic_parser)
     stack_offset = 0;
 
-  sprintf (buf, "\ncase %d:\n", nrules);
-  obstack_grow (&action_obstack, buf, strlen (buf));
+  obstack_fgrow1 (&action_obstack, "\ncase %d:\n", nrules);
 
   if (!no_lines_flag)
     {
-      sprintf (buf, "#line %d %s\n",
-              lineno, quotearg_style (c_quoting_style, 
-                                      muscle_find ("filename")));
-      obstack_grow (&action_obstack, buf, strlen (buf));
+      obstack_fgrow2 (&action_obstack, muscle_find ("linef"),
+                     lineno, quotearg_style (c_quoting_style, 
+                                             muscle_find ("filename")));
     }
   obstack_1grow (&action_obstack, '{');
 
@@ -1201,7 +1205,7 @@
 
   obstack_fgrow1 (&guard_obstack, "\ncase %d:\n", nrules);
   if (!no_lines_flag)
-    obstack_fgrow2 (&guard_obstack, "#line %d %s\n",
+    obstack_fgrow2 (&guard_obstack, muscle_find ("linef"),
                    lineno, quotearg_style (c_quoting_style,
                                            muscle_find ("filename")));
   obstack_1grow (&guard_obstack, '{');


-- 
Autret Marc (address@hidden)
Eleve Ingenieur en Informatique.



reply via email to

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