From patchwork Tue Mar 14 20:35:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 9624453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B03A604A9 for ; Tue, 14 Mar 2017 20:35:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D31C285C3 for ; Tue, 14 Mar 2017 20:35:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11A72285C5; Tue, 14 Mar 2017 20:35:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 85C52285C3 for ; Tue, 14 Mar 2017 20:35:41 +0000 (UTC) Received: from localhost ([::1]:33402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cntAS-0008K2-3V for patchwork-qemu-devel@patchwork.kernel.org; Tue, 14 Mar 2017 16:35:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cntAF-0008J8-7K for qemu-devel@nongnu.org; Tue, 14 Mar 2017 16:35:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cntAC-000775-45 for qemu-devel@nongnu.org; Tue, 14 Mar 2017 16:35:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44192) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cntAB-000755-RR for qemu-devel@nongnu.org; Tue, 14 Mar 2017 16:35:24 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C59CD85547; Tue, 14 Mar 2017 20:35:23 +0000 (UTC) Received: from [10.10.121.52] (ovpn-121-52.rdu2.redhat.com [10.10.121.52] (may be forged)) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EKZMgT002780; Tue, 14 Mar 2017 16:35:23 -0400 To: Markus Armbruster , qemu-devel@nongnu.org References: <1489385927-6735-1-git-send-email-armbru@redhat.com> <1489385927-6735-32-git-send-email-armbru@redhat.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: Date: Tue, 14 Mar 2017 15:35:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1489385927-6735-32-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 14 Mar 2017 20:35:23 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [Qemu-devel] [PATCH for-2.9 31/47] qapi: Fix detection of doc / expression mismatch X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 03/13/2017 01:18 AM, Markus Armbruster wrote: > This fixes the errors uncovered by the previous commit. > > Signed-off-by: Markus Armbruster > --- > > expr = self.get_expr(False) > if 'include' in expr: > + self.reject_expr_doc() > if len(expr) != 1: Do you also need to handle 'pragma' expressions added earlier in the series? /me goes and experiments: Oops - back to accepting the program. diff --git i/tests/qapi-schema/doc-bad-expr.json w/tests/qapi-schema/doc-bad-expr.json index 0caa0ae..6c1204d 100644 --- i/tests/qapi-schema/doc-bad-expr.json +++ w/tests/qapi-schema/doc-bad-expr.json @@ -4,4 +4,5 @@ # @foo: ## { 'include': 'empty.json' } +{ 'pragma': {} } { 'struct': 'foo', 'data': {} }