From nobody Sat May 11 11:56:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1632155346; cv=none; d=zohomail.com; s=zohoarc; b=i0tuqaC0vpyrMxB5l+5sOi+ARolMQ82csgYulVGr8hF7YCbsB4KFEe73TlTIfNiIr1Ed4ckyudcYW0HkM4dsaCnUlfXcCRaxMrAr6vjco94seDlpngP/gCSwOWYnK+TiWWdLzdPxgvD5vY1nsq7385DWq9dxhEE1GgNhgXoV5JY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632155346; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=dfA23Vaxy7NkBunC90ZZsGLWaEchS6nmetpm8apR/30=; b=lB+BQ/9O6X1IRb1IzrE7UOytBj8fW3ItZLF7Xvx6TYA6Jl0c6w2zoXPK+Lt3IXjeroNeVZzyvLEZAI9FgjlkzeaxW8EVMVFRoHD6m78MqfvQdZ6330L/U8+Zb3eA0wk7ylR3oXNFsbTKXTz0mOlX6ilN1085VUJx5rDxi6g0FSE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1632155346145353.3953745396419; Mon, 20 Sep 2021 09:29:06 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-592-fk87KL2tOJCygS4v6pu-SQ-1; Mon, 20 Sep 2021 12:29:03 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6CFD610168C8; Mon, 20 Sep 2021 16:28:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1E84F60C17; Mon, 20 Sep 2021 16:28:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7D8344ED4F; Mon, 20 Sep 2021 16:28:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18KGR6B5023996 for ; Mon, 20 Sep 2021 12:27:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7D9AC17B5B; Mon, 20 Sep 2021 16:27:06 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.195.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA1775D9D5; Mon, 20 Sep 2021 16:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632155345; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dfA23Vaxy7NkBunC90ZZsGLWaEchS6nmetpm8apR/30=; b=ZjLe+EyNrZmpLTuzw6MjOBhcK6ol1IQatYmaXyOalkx2/3Dv1EMEbc+AK/kOhVcgYheHfO pH7+aRl8wBlJ2+MwmG1RCVJV3ATuAZdCP6rgAn6uCqamH9aJv5ZA+vs1GAb8lxRN5Pvf2p do/5agdXk7w0YB3liu454UmGu/GB07U= X-MC-Unique: fk87KL2tOJCygS4v6pu-SQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH] scripts: fix API parsing of *** pointers Date: Mon, 20 Sep 2021 17:27:04 +0100 Message-Id: <20210920162704.2189224-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1632155346841100001 The currrent generated API contains *** pointer types with bogus whitespace in the middle: because the tokenizer only tries to merge 2 distinct '*' together. This refactors the code to merge an arbitrary number, resulting in Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- scripts/apibuild.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/apibuild.py b/scripts/apibuild.py index b94c0f6c09..722fd33f0e 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -603,13 +603,12 @@ class CLexer: i =3D i + 3 continue =20 - j =3D i + 1 - if j < nline and line[j] in "+-*><=3D/%&!|": - self.tokens.append(('op', line[i:j + 1])) - i =3D j + 1 - else: - self.tokens.append(('op', line[i])) - i =3D i + 1 + j =3D i + while (j + 1) < nline and line[j+1] in "+-*><=3D/%&!|": + j =3D j + 1 + + self.tokens.append(('op', line[i:j+1])) + i =3D j + 1 continue s =3D i while i < nline: --=20 2.31.1