From patchwork Wed Jul 25 16:54:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 173224 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 704A62C0092 for ; Thu, 26 Jul 2012 03:25:44 +1000 (EST) Received: from localhost ([::1]:44774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su5LC-0006P8-FQ for incoming@patchwork.ozlabs.org; Wed, 25 Jul 2012 13:25:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su4rK-0003ep-5q for qemu-devel@nongnu.org; Wed, 25 Jul 2012 12:54:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Su4rF-0001Ka-UN for qemu-devel@nongnu.org; Wed, 25 Jul 2012 12:54:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61143) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su4rF-0001KS-Ms for qemu-devel@nongnu.org; Wed, 25 Jul 2012 12:54:45 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6PGrptY012599 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 25 Jul 2012 12:53:52 -0400 Received: from localhost (ovpn-113-89.phx2.redhat.com [10.3.113.89]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6PGrowk018124; Wed, 25 Jul 2012 12:53:51 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 25 Jul 2012 13:54:12 -0300 Message-Id: <1343235256-26310-8-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1343235256-26310-1-git-send-email-lcapitulino@redhat.com> References: <1343235256-26310-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, aliguori@us.ibm.com, armbru@redhat.com, mdroth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 07/11] qapi: qapi.py: allow the "'" character be escaped X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org A future commit will add a new qapi script which escapes that character. Signed-off-by: Luiz Capitulino --- scripts/qapi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index e062336..9aa518f 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -21,7 +21,9 @@ def tokenize(data): elif data[0] == "'": data = data[1:] string = '' - while data[0] != "'": + while True: + if data[0] == "'" and string[len(string)-1] != "\\": + break string += data[0] data = data[1:] data = data[1:]