X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/e58782294dfdb5ca6f8c69dd65a1ccfb9597efb3..a68b1f237e63c96ee905916424013f79d01908ba:/src/muscle-tab.c diff --git a/src/muscle-tab.c b/src/muscle-tab.c index b2dca77d..bd1fd174 100644 --- a/src/muscle-tab.c +++ b/src/muscle-tab.c @@ -177,10 +177,10 @@ static void muscle_syncline_grow (char const *key, location loc) { char *extension = NULL; - obstack_fgrow1 (&muscle_obstack, "]b4_syncline(%d, [[", loc.start.line); - obstack_escape (&muscle_obstack, - quotearg_style (c_quoting_style, loc.start.file)); - obstack_sgrow (&muscle_obstack, "]])["); + obstack_printf (&muscle_obstack, "]b4_syncline(%d, ", loc.start.line); + obstack_quote (&muscle_obstack, + quotearg_style (c_quoting_style, loc.start.file)); + obstack_sgrow (&muscle_obstack, ")["); obstack_1grow (&muscle_obstack, 0); extension = obstack_finish (&muscle_obstack); muscle_grow (key, extension, ""); @@ -205,11 +205,11 @@ void muscle_pair_list_grow (const char *muscle, const char *a1, const char *a2) { char *pair; - obstack_sgrow (&muscle_obstack, "[[["); - obstack_escape (&muscle_obstack, a1); - obstack_sgrow (&muscle_obstack, "]], [["); - obstack_escape (&muscle_obstack, a2); - obstack_sgrow (&muscle_obstack, "]]]"); + obstack_sgrow (&muscle_obstack, "["); + obstack_quote (&muscle_obstack, a1); + obstack_sgrow (&muscle_obstack, ", "); + obstack_quote (&muscle_obstack, a2); + obstack_sgrow (&muscle_obstack, "]"); obstack_1grow (&muscle_obstack, 0); pair = obstack_finish (&muscle_obstack); muscle_grow (muscle, pair, ",\n"); @@ -266,12 +266,14 @@ static void muscle_boundary_grow (char const *key, boundary bound) { char *extension; + obstack_sgrow (&muscle_obstack, "[["); obstack_escape (&muscle_obstack, bound.file); - obstack_1grow (&muscle_obstack, ':'); - obstack_fgrow1 (&muscle_obstack, "%d", bound.line); - obstack_1grow (&muscle_obstack, '.'); - obstack_fgrow1 (&muscle_obstack, "%d", bound.column); - obstack_1grow (&muscle_obstack, '\0'); + obstack_1grow (&muscle_obstack, ':'); + obstack_printf (&muscle_obstack, "%d", bound.line); + obstack_1grow (&muscle_obstack, '.'); + obstack_printf (&muscle_obstack, "%d", bound.column); + obstack_sgrow (&muscle_obstack, "]]"); + obstack_1grow (&muscle_obstack, '\0'); extension = obstack_finish (&muscle_obstack); muscle_grow (key, extension, ""); obstack_free (&muscle_obstack, extension); @@ -285,11 +287,9 @@ muscle_boundary_grow (char const *key, boundary bound) static void muscle_location_grow (char const *key, location loc) { - muscle_grow (key, "[[", ""); muscle_boundary_grow (key, loc.start); - muscle_grow (key, "]], [[", ""); + muscle_grow (key, "", ", "); muscle_boundary_grow (key, loc.end); - muscle_grow (key, "]]", ""); } #define COMMON_DECODE(Value) \