[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/8] muscles: shuffle responsabilities
From: |
Akim Demaille |
Subject: |
[PATCH 6/8] muscles: shuffle responsabilities |
Date: |
Thu, 26 Jul 2012 12:44:20 +0200 |
* src/muscle-tab.c (muscle_boundary_grow): Be in charge of quotation,
instead of leaving this to the caller.
---
src/muscle-tab.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/muscle-tab.c b/src/muscle-tab.c
index b2dca77..a498b15 100644
--- a/src/muscle-tab.c
+++ b/src/muscle-tab.c
@@ -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_1grow (&muscle_obstack, ':');
obstack_fgrow1 (&muscle_obstack, "%d", bound.line);
- obstack_1grow (&muscle_obstack, '.');
+ obstack_1grow (&muscle_obstack, '.');
obstack_fgrow1 (&muscle_obstack, "%d", bound.column);
- obstack_1grow (&muscle_obstack, '\0');
+ 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) \
--
1.7.11.3
- [PATCH 0/8] {maint} Properly escape type names, Akim Demaille, 2012/07/26
- [PATCH 2/8] remove dead macro, Akim Demaille, 2012/07/26
- [PATCH 5/8] muscles: make private functions static, Akim Demaille, 2012/07/26
- [PATCH 3/8] obstack_escape: escape M4 characters, Akim Demaille, 2012/07/26
- [PATCH 1/8] maint: style changes, Akim Demaille, 2012/07/26
- [PATCH 4/8] muscles: rename private functions/macros, Akim Demaille, 2012/07/26
- [PATCH 6/8] muscles: shuffle responsabilities,
Akim Demaille <=
- [PATCH 7/8] obstack_quote: escape and quote for M4, Akim Demaille, 2012/07/26
- [PATCH 8/8] be sure to properly escape type names, Akim Demaille, 2012/07/26