From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2jz0-0000X7-W9 for qemu-devel@nongnu.org; Fri, 26 Jul 2013 11:31:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2jyz-0003dh-P6 for qemu-devel@nongnu.org; Fri, 26 Jul 2013 11:31:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2jyz-0003dc-H1 for qemu-devel@nongnu.org; Fri, 26 Jul 2013 11:31:05 -0400 Message-ID: <51F29620.9090108@redhat.com> Date: Fri, 26 Jul 2013 09:30:40 -0600 From: Eric Blake MIME-Version: 1.0 References: <1374842387-17146-1-git-send-email-armbru@redhat.com> <1374842387-17146-5-git-send-email-armbru@redhat.com> In-Reply-To: <1374842387-17146-5-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4nUqupVu4AiBeq2KcjeuC4DUAT171p7co" Subject: Re: [Qemu-devel] [PATCH 4/9] qapi.py: Decent syntax error reporting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: aliguori@us.ibm.com, akong@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4nUqupVu4AiBeq2KcjeuC4DUAT171p7co Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/26/2013 06:39 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > scripts/qapi.py | 29 +++++++++++++++++++++++++++= -- > tests/qapi-schema/test-qapi.py | 2 ++ > tests/qapi-schema/unclosed-string.err | 2 +- > 3 files changed, 30 insertions(+), 3 deletions(-) > =20 > +class QAPISchemaError(Exception): > + def __init__(self, schema, msg): > + self.fp =3D schema.fp > + self.msg =3D msg > + self.line =3D self.col =3D 1 > + for ch in schema.src[0:schema.pos]: > + if ch =3D=3D '\n': > + self.line +=3D 1 > + self.col =3D 1 > + elif ch =3D=3D '\t': > + self.col =3D (self.col + 7) % 8 + 1 Do we even want to allow TABs in the schema files? Right now, they are tab-free; if you error out here instead of futzing with tab width, we could forcefully maintain that property. > + else: > + self.col +=3D 1 Does python support ++ as shorthand for +=3D 1? Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --4nUqupVu4AiBeq2KcjeuC4DUAT171p7co Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR8pYgAAoJEKeha0olJ0NqUs4H/jTADfB0ZGMP3cwov2LpXcj2 SQm5MVcr1FiwkYPK8Noif6LEF0f4zwdic1+skwVZABMF3/iu7K4qBwNo/30+ANHB 2nOCdXaDgAIzEbmLe93oMqZSjzhR/AkHelyMdcRqyZXjGMkR5XDFyp4iqKPRO/xQ QaOwmQvWk8/63AYrPsMD4eJOVB4W1QP6xEKFlKrAmU2OlzKn1Qkj4O9yZG0VY2yg 77iaKse2HHQlJjUJRnrhpGyE/o8FNCYuGFFXszuOVPF4LT1tSX2w97NjeXBafVmd +NlLHP5LDI0pm5rgCCoDqYb7el7gPhH81eDeeD+vZJmukVPQiiePXiO2WxnY4b4= =Nnvy -----END PGP SIGNATURE----- --4nUqupVu4AiBeq2KcjeuC4DUAT171p7co--