From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDoc1-0005fO-Pv for qemu-devel@nongnu.org; Fri, 17 Jun 2016 03:54:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDobx-00016S-Kx for qemu-devel@nongnu.org; Fri, 17 Jun 2016 03:54:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDobx-00015q-Eo for qemu-devel@nongnu.org; Fri, 17 Jun 2016 03:54:41 -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 97A2863315 for ; Fri, 17 Jun 2016 07:54:40 +0000 (UTC) From: Markus Armbruster 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> <5762E4D2.3090700@redhat.com> Date: Fri, 17 Jun 2016 09:54:38 +0200 In-Reply-To: <5762E4D2.3090700@redhat.com> (Eric Blake's message of "Thu, 16 Jun 2016 11:41:38 -0600") Message-ID: <87oa70merl.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain 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: Eric Blake Cc: qemu-devel@nongnu.org, Luiz Capitulino Eric Blake writes: > On 06/16/2016 10:19 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> 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 >> >> Reviewed-by: Markus Armbruster >> >> I'll take this one through qapi-next. Thanks! >> > > 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: > * Doesn't apply as is, but I get what you mean. Applied to qapi-next, please double-check the result there. Thanks!