From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Stinq-0003uC-P6 for qemu-devel@nongnu.org; Tue, 24 Jul 2012 13:21:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Stinp-0000U4-P9 for qemu-devel@nongnu.org; Tue, 24 Jul 2012 13:21:46 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:53639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Stinp-0000Fl-J1 for qemu-devel@nongnu.org; Tue, 24 Jul 2012 13:21:45 -0400 Received: by mail-pb0-f45.google.com with SMTP id ro12so12773613pbb.4 for ; Tue, 24 Jul 2012 10:21:45 -0700 (PDT) Sender: fluxion From: Michael Roth Date: Tue, 24 Jul 2012 12:20:42 -0500 Message-Id: <1343150454-4677-11-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1343150454-4677-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1343150454-4677-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 10/22] qapi: qapi.py, make json parser more robust List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, quintela@redhat.com, owasserm@redhat.com, yamahata@valinux.co.jp, pbonzini@redhat.com, akong@redhat.com, afaerber@suse.de Currently the QAPI JSON parser expects a very particular style of code indentation, the major one being that terminating curly/square brackets are not on placed on a seperate line. This is incompatible with most pretty-print formats, so make it a little more robust by supporting these cases. Signed-off-by: Michael Roth --- scripts/qapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 39bb74e..e0c694d 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -70,7 +70,7 @@ def parse_schema(fp): if line.startswith('#') or line == '\n': continue - if line.startswith(' '): + if line[0] in ['}', ']', ' ', '\t']: expr += line elif expr: expr_eval = evaluate(expr) -- 1.7.9.5