From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmpax-0007JZ-Kp for qemu-devel@nongnu.org; Tue, 20 May 2014 15:21:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wmpas-0002qr-Vs for qemu-devel@nongnu.org; Tue, 20 May 2014 15:21:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmpas-0002qk-OD for qemu-devel@nongnu.org; Tue, 20 May 2014 15:20:58 -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 s4KJKvsO024613 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 May 2014 15:20:57 -0400 Message-ID: <537BAB18.6090708@redhat.com> Date: Tue, 20 May 2014 13:20:56 -0600 From: Eric Blake MIME-Version: 1.0 References: <1400576881-6954-1-git-send-email-famz@redhat.com> <1400576881-6954-3-git-send-email-famz@redhat.com> In-Reply-To: <1400576881-6954-3-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cOAABlg0x32MC4qd38Kl07McoSVv87tCJ" Subject: Re: [Qemu-devel] [RFC PATCH v2 2/7] qapi: Allow true, false and null in schema json List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cOAABlg0x32MC4qd38Kl07McoSVv87tCJ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/20/2014 03:07 AM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > scripts/qapi.py | 24 +++++++++++++++++------- > 1 file changed, 17 insertions(+), 7 deletions(-) I applied this patch and tried to break things. Pre-patch, { 'random': tru } =3D> foo.json:1:13: Stray "t" { 'random': true } =3D> foo.json:1:13: Stray "t" { 'random': truest } =3D> foo.json:1:13: Stray "t" Post-patch, { 'random': tru } =3D> foo.json:1:14: Stray "r" { 'random': true } =3D> accepted { 'random': truest } =3D> foo.json:1:17: Stray "s" Not ideal that you are reporting a different stray character based on how much (1 or 4 bytes) that you tentatively already consumed. Better might be to report a stray word (all characters until the next whitespace, starting at the first bare character rather than mid-word). Are these cases tested in 3/7? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cOAABlg0x32MC4qd38Kl07McoSVv87tCJ 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTe6sYAAoJEKeha0olJ0NqNrsH/1N4mnYTrYbGFgRC95i2sE0w AWtQjhNfX1FvS8Ks/GHhKgP+XxEgOxIs8HDdSTHvVp2GZPkbT0CK/ev+iNW8QAq4 44kJx0uBP1pzsi9qvOTLAsV5yFTP8TS/aU2IRm7zxZ3C8z0k10pLKbOVqER9Ofge jjuLAAue5IxVfLm4woJXHF7yc1Vs7xqRsvsslWObngfRAkWlUkI+1Q/oeOD+IyJz F3i4g1vnQ90ZxBVpP7im8GqDmrYfX9NlYZoTHLoA1MU987PVytr3ybh6ZrPhBPmM 9DQQRltexE58o4laeZiZHNLs2mTLKz93xysntuhQ62zNZWCy7jEbsU+1M21ACDU= =uMMe -----END PGP SIGNATURE----- --cOAABlg0x32MC4qd38Kl07McoSVv87tCJ--