From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDbIV-0007ZK-4Z for qemu-devel@nongnu.org; Thu, 16 Jun 2016 13:41:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDbIR-0005dQ-RQ for qemu-devel@nongnu.org; Thu, 16 Jun 2016 13:41:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDbIR-0005dI-JP for qemu-devel@nongnu.org; Thu, 16 Jun 2016 13:41:39 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3220568A7 for ; Thu, 16 Jun 2016 17:41:39 +0000 (UTC) References: <1465526889-8339-1-git-send-email-eblake@redhat.com> <1465526889-8339-2-git-send-email-eblake@redhat.com> <87bn31w1h0.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <5762E4D2.3090700@redhat.com> Date: Thu, 16 Jun 2016 11:41:38 -0600 MIME-Version: 1.0 In-Reply-To: <87bn31w1h0.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="s1uvpq22n2tAEmnr9im2okcb2vrl6oEE3" Subject: Re: [Qemu-devel] [PATCH 1/4] qobject: Correct JSON lexer grammar comments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --s1uvpq22n2tAEmnr9im2okcb2vrl6oEE3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/16/2016 10:19 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> Fix the regex comments describing what we parse as JSON. No change >> to the lexer itself, just to the comments: >> - The "" and '' string construction was missing alternation between >> different escape sequences >> - The construction for numbers forgot to handle optional leading '-' >> - The construction for numbers was grouped incorrectly so that it >> didn't permit '0.1' >> - The construction for numbers forgot to mark the exponent as optional= >> - No mention that our '' string and "\'" are JSON extensions >> - No mention of our %d and related extensions when constructing JSON >> >> Signed-off-by: Eric Blake >=20 > Reviewed-by: Markus Armbruster >=20 > I'll take this one through qapi-next. Thanks! >=20 You may want to squash this in for shorter lines: diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c index de16219..b030576 100644 --- a/qobject/json-lexer.c +++ b/qobject/json-lexer.c @@ -21,16 +21,14 @@ * Required by JSON (RFC 7159), plus \' extension in "", and extension * of parsing case-insensitive non-finite numbers like "NaN" and "-Inf":= * - * \"([^\\\"]|(\\\"|\\'|\\\\|\\/|\\b|\\f|\\n|\\r|\\t| - * \\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]))*\" + * \"([^\\\"]|\\[\"'\\/bfnrt]|\\u[0-9a-fA-F]{4})*\" * -?(0|[1-9][0-9]*)(.[0-9]+)?([eE][-+]?[0-9]+)? * [{}\[\],:] * -?[a-zA-Z]+ # covers null, true, false, nan, inf[inity] * * Extension of '' strings: * - * '([^\\']|(\\\"|\\'|\\\\|\\/|\\b|\\f|\\n|\\r|\\t| - * \\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]))*' + * '([^\\']|\\[\"'\\/bfnrt]|\\u[0-9a-fA-F]{4})*' * * Extension for vararg handling in JSON construction: * Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --s1uvpq22n2tAEmnr9im2okcb2vrl6oEE3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXYuTSAAoJEKeha0olJ0NqKJYIAJlvMdpGQ8LP6WrhH4kDW5Rk 1VwwbPLUcPYtEyJSWIhaYbED3QXdYjQDxPyaYpnxd6VHyQdlygRsHsoBHYAm4u7f XL7MsOstKXOr2faMeoW2//bB3g9nYlsjRVdASze4BRCdVbOWYJlGnd85WS9hIh1h q9uv5T3R34g6YNrpxaz8Yc38nEmeV5AQ8a43KcBTNN6tc6n4X4TX5rqcnv3GHCnx Pd+THmsw+ZHsiHu3UL0CM7PpcAb+r8+yV6J4W7i1m5eVqtLE2NoZ0WvN8Ud5glYS vI43aRHtue/OCUrnOZ30MlGduhInWtdFc++C4hFHjMYiC7staa8gqn1TWo4opFo= =CQRT -----END PGP SIGNATURE----- --s1uvpq22n2tAEmnr9im2okcb2vrl6oEE3--