validate: Add { and [ as line continuation markers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/177>
This commit is contained in:
Thibault Saunier 2020-04-21 15:28:00 -04:00
parent 856944c960
commit 4f7217b0b3

View file

@ -558,6 +558,7 @@ skip_spaces (gchar * c)
} }
/* Parse file that contains a list of GStructures */ /* Parse file that contains a list of GStructures */
#define GST_STRUCT_LINE_CONTINUATION_CHARS ",{\\["
static GList * static GList *
_file_get_structures (GFile * file, gchar ** err) _file_get_structures (GFile * file, gchar ** err)
{ {
@ -609,9 +610,9 @@ _file_get_structures (GFile * file, gchar ** err)
while (*tmp != '\n' && *tmp) { while (*tmp != '\n' && *tmp) {
gchar next = *(tmp + 1); gchar next = *(tmp + 1);
/* ',' and '\\' are line continuation indicators */ if (next && next == '\n'
if (next && next == '\n' && (*tmp == ',' || *tmp == '\\')) { && strchr (GST_STRUCT_LINE_CONTINUATION_CHARS, *tmp)) {
if (*tmp == ',') if (*tmp != '\\')
g_string_append_c (l, *tmp); g_string_append_c (l, *tmp);
tmp += 2; tmp += 2;