Received: from eggs.gnu.org ([2001:4830:134:3::10]:42797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drMYK-000568-Tb for qemu-devel@nongnu.org; Mon, 11 Sep 2017 07:06:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drMYK-0006B1-1v for qemu-devel@nongnu.org; Mon, 11 Sep 2017 07:06:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37028) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1drMYJ-0006As-Sz for qemu-devel@nongnu.org; Mon, 11 Sep 2017 07:06:55 -0400 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 11 Sep 2017 13:05:43 +0200 Message-Id: <20170911110623.24981-11-marcandre.lureau@redhat.com> In-Reply-To: <20170911110623.24981-1-marcandre.lureau@redhat.com> References: <20170911110623.24981-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3 10/50] qapi-introspect: modify to_qlit() to append ', ' on level > 0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Michael Roth 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=C3=A9 Lureau --- 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=3D0, suppress_first_indent=3DFal= se): for elt in obj] elts.append(indent(level + 1) + "{}") ret +=3D 'QLIT_QLIST(((QLitObject[]) {\n' - ret +=3D ',\n'.join(elts) + '\n' + ret +=3D '\n'.join(elts) + '\n' ret +=3D indent(level) + '}))' elif isinstance(obj, dict): elts =3D [] @@ -42,6 +42,8 @@ def to_qlit(obj, level=3D0, suppress_first_indent=3DFal= se): ret +=3D indent(level) + '}))' else: assert False # not implemented + if level > 0: + ret +=3D ',' return ret =20 =20 --=20 2.14.1.146.gd35faa819