]> git.saurik.com Git - bison.git/commitdiff
(MUSCLE_GROW_STRING_PAIR): Remove; unused.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 12 Nov 2002 07:24:33 +0000 (07:24 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 12 Nov 2002 07:24:33 +0000 (07:24 +0000)
(MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.

src/muscle_tab.h

index 3b186c12309885d7f8155ca14d96b1f4d3a33b83..f15e005c84993a65beb07b85081f376a2c9573ab 100644 (file)
@@ -57,9 +57,25 @@ extern struct obstack muscle_obstack;
   muscle_insert (Key, obstack_finish (&muscle_obstack));       \
 }
 
-#define MUSCLE_GROW_STRING_PAIR(Key, Value1, Value2)           \
+#define MUSCLE_OBSTACK_SGROW(Obstack, Value)                   \
 {                                                              \
-  obstack_sgrow (&muscle_obstack, Value1);                     \
+  char const *s;                                               \
+  for (s = Value; *s; s++)                                     \
+    switch (*s)                                                        \
+      {                                                                \
+      case '$':        obstack_sgrow (Obstack, "$]["); break;          \
+      case '@':        obstack_sgrow (Obstack, "@@" ); break;          \
+      case '[':        obstack_sgrow (Obstack, "@{" ); break;          \
+      case ']':        obstack_sgrow (Obstack, "@}" ); break;          \
+      default: obstack_1grow (Obstack, *s); break;             \
+      }                                                                \
+}
+
+#define MUSCLE_INSERT_C_STRING(Key, Value)                     \
+{                                                              \
+  MUSCLE_OBSTACK_SGROW (&muscle_obstack,                       \
+                       quotearg_style (c_quoting_style,        \
+                                       Value));                \
   obstack_1grow (&muscle_obstack, 0);                          \
   muscle_insert (Key, obstack_finish (&muscle_obstack));       \
 }