From patchwork Wed Jul 18 17:49:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 171805 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 BF4412C008B for ; Thu, 19 Jul 2012 04:27:01 +1000 (EST) Received: from localhost ([::1]:33212 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrYOB-0000BD-AH for incoming@patchwork.ozlabs.org; Wed, 18 Jul 2012 13:50:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrYNL-0006KM-Ma for qemu-devel@nongnu.org; Wed, 18 Jul 2012 13:49:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrYNK-00075u-PD for qemu-devel@nongnu.org; Wed, 18 Jul 2012 13:49:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrYNK-00075k-HT for qemu-devel@nongnu.org; Wed, 18 Jul 2012 13:49:26 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6IHnPia008972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 Jul 2012 13:49:26 -0400 Received: from localhost (ovpn-113-90.phx2.redhat.com [10.3.113.90]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6IHnNV1017119; Wed, 18 Jul 2012 13:49:24 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 18 Jul 2012 14:49:16 -0300 Message-Id: <1342633760-351-6-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1342633760-351-1-git-send-email-lcapitulino@redhat.com> References: <1342633760-351-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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 Subject: [Qemu-devel] [PATCH 5/9] 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:]