The following patch is going to break list entries with #if/#endif, so they should have the trailing ',' as suffix.
Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> --- scripts/qapi-introspect.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py index 56c1f9d548..b1d08ec97b 100644 --- a/scripts/qapi-introspect.py +++ b/scripts/qapi-introspect.py @@ -29,7 +29,7 @@ def to_qlit(obj, level=0, suppress_first_indent=False): for elt in obj] elts.append(indent(level + 1) + "{}") ret += 'QLIT_QLIST(((QLitObject[]) {\n' - ret += ',\n'.join(elts) + '\n' + ret += '\n'.join(elts) + '\n' ret += indent(level) + '}))' elif isinstance(obj, dict): elts = [] @@ -42,6 +42,8 @@ def to_qlit(obj, level=0, suppress_first_indent=False): ret += indent(level) + '}))' else: assert False # not implemented + if level > 0: + ret += ',' return ret -- 2.16.0.rc1.1.gef27df75a1