mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 00:33:03 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user