From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2iTV-000789-Na for qemu-devel@nongnu.org; Fri, 26 Jul 2013 09:54:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2iTT-0005Ui-Ut for qemu-devel@nongnu.org; Fri, 26 Jul 2013 09:54:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2iTT-0005UZ-Ml for qemu-devel@nongnu.org; Fri, 26 Jul 2013 09:54:27 -0400 Message-ID: <51F27F90.7060307@redhat.com> Date: Fri, 26 Jul 2013 07:54:24 -0600 From: Eric Blake MIME-Version: 1.0 References: <1374842387-17146-1-git-send-email-armbru@redhat.com> <1374842387-17146-4-git-send-email-armbru@redhat.com> In-Reply-To: <1374842387-17146-4-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nLRFHpbunTnoGtwV5OFNGMqlt2KUQjb9P" Subject: Re: [Qemu-devel] [PATCH 3/9] qapi.py: Restructure lexer and parser 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) --nLRFHpbunTnoGtwV5OFNGMqlt2KUQjb9P Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/26/2013 06:39 AM, Markus Armbruster wrote: > The parser has a rather unorthodox structure: >=20 >=20 > Replace this piece of original art by a thoroughly unoriginal design. I sense a bit of tongue-in-cheek urge to use more colorful language at this point, describing the horrors of the old implementation. Thank you for thinking of the children :) > Takes care of (1), (2), (5), (6) and (7), and lays the groundwork for > addressing the others. Generated source files remain unchanged. >=20 > Signed-off-by: Markus Armbruster > --- > scripts/qapi.py | 163 +++++++++++++----= -------- > tests/qapi-schema/indented-expr.out | 2 +- > tests/qapi-schema/missing-colon.out | 4 +- > tests/qapi-schema/quoted-structural-chars.err | 1 + > tests/qapi-schema/quoted-structural-chars.exit | 2 +- > tests/qapi-schema/quoted-structural-chars.out | 3 - > 6 files changed, 88 insertions(+), 87 deletions(-) My python review skills are weak, so take this review with a grain of sal= t. > + > + def get_members(self): > + expr =3D OrderedDict() > + while self.tok !=3D '}': > + key =3D self.val > + self.accept() > + self.accept() # : > + expr[key] =3D self.get_expr() > + if self.tok =3D=3D ',': > + self.accept() My comments in 1/9 about a test of trailing comma behavior may impact this code. > + self.accept() > + return expr > + > + def get_values(self): > + expr =3D [] > + while self.tok !=3D ']': > + expr.append(self.get_expr()) > + if self.tok =3D=3D ',': > + self.accept() and this code. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --nLRFHpbunTnoGtwV5OFNGMqlt2KUQjb9P 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/ iQEcBAEBCAAGBQJR8n+QAAoJEKeha0olJ0Nq4HkH/0XdUl1oeRvIlZ3Xke2G40Sd S9OlTpOMkiEoeUXZDMHPqcw10LndjKiAP501jDWusBq3Q6QVby3kYUB7MhaMv+vO 85w5CUeYDH/Ropf4wFg2WboSU8g0wKPNRiaMWdi6vN734VvP8a4JIwZW/8emymr9 fHyT3lGx7QyPi1RQpzgh+PdQfmH2AW4f0LmKZRXqnKfXTOa5ccqs0gl2wG3s4i/A 4tUWuzzPmxzO74icfX4a/kjfEgSgVnLbgWT4KhtlX6gXoMMeOQxX1bmVr5Iv6Kk0 p7OMDoDwm0yu67bqftQlzLd80JGbPdrztj1y/uH7zDwW6ZhKsxPpf54wggvW0aM= =E+UC -----END PGP SIGNATURE----- --nLRFHpbunTnoGtwV5OFNGMqlt2KUQjb9P--