muscles: be sure that %code snippets are not glue together on a single line

Recently "braceless" in the parser was changed so that an eol was no
longer added to the value.  This is not correct when a %code is used
multiple times, because the syncline of the next snippet might be
appended to the last (and not ended) line of the previous snippet.

* src/muscle-tab.h (muscle_grow): Make it private.
* src/muscle-tab.c (muscle_grow): Accept a fourth argument: a required
terminator.
Adjust callers.
* tests/input.at (Multiple %code): New.
This commit is contained in:
Akim Demaille
2013-04-11 09:21:08 +02:00
parent edaa22ec15
commit 08cc1a3b18
3 changed files with 74 additions and 34 deletions

View File

@@ -99,14 +99,9 @@ extern struct obstack muscle_obstack;
MUSCLE_INSERT_STRING(Key, quotearg_style (c_quoting_style, Value))
/* Append VALUE to the current value of KEY. If KEY did not already
exist, create it. Use MUSCLE_OBSTACK. De-allocate the previously
associated value. Copy VALUE and SEPARATOR. */
void muscle_grow (const char *key, const char *value, const char *separator);
/* Append VALUE to the current value of KEY, using muscle_grow. But
in addition, issue a synchronization line for the location LOC. */
in addition, issue a synchronization line for the location LOC.
Be sure to append on a new line. */
void muscle_code_grow (const char *key, const char *value, location loc);