From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1rpL-00088t-7R for qemu-devel@nongnu.org; Thu, 26 Nov 2015 03:22:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1rpI-0005ic-4N for qemu-devel@nongnu.org; Thu, 26 Nov 2015 03:22:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1rpH-0005iX-VX for qemu-devel@nongnu.org; Thu, 26 Nov 2015 03:22:48 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 41E18A1423 for ; Thu, 26 Nov 2015 08:22:47 +0000 (UTC) From: Markus Armbruster References: <1448486613-17634-1-git-send-email-armbru@redhat.com> <1448486613-17634-6-git-send-email-armbru@redhat.com> <565630C3.3040106@redhat.com> Date: Thu, 26 Nov 2015 09:22:44 +0100 In-Reply-To: <565630C3.3040106@redhat.com> (Eric Blake's message of "Wed, 25 Nov 2015 15:05:55 -0700") Message-ID: <87h9k9map7.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v3 for-2.5 05/12] qjson: Give each of the six structural chars its own token type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com Eric Blake writes: > On 11/25/2015 02:23 PM, Markus Armbruster wrote: >> Simplifies things, because we always check for a specific one. >> >> Signed-off-by: Markus Armbruster >> --- >> include/qapi/qmp/json-lexer.h | 7 ++++++- >> qobject/json-lexer.c | 19 ++++++++++++------- >> qobject/json-parser.c | 31 +++++++++---------------------- >> qobject/json-streamer.c | 32 +++++++++++++++----------------- >> 4 files changed, 42 insertions(+), 47 deletions(-) > > Diffstat shows that it is already a win, even if slight; the real win is > that later patches are easier :) > >> >> diff --git a/include/qapi/qmp/json-lexer.h b/include/qapi/qmp/json-lexer.h >> index 61a143f..f3e8dc7 100644 >> --- a/include/qapi/qmp/json-lexer.h >> +++ b/include/qapi/qmp/json-lexer.h >> @@ -19,7 +19,12 @@ >> >> typedef enum json_token_type { >> JSON_MIN = 100, >> - JSON_OPERATOR = JSON_MIN, >> + JSON_LCURLY = JSON_MIN, >> + JSON_RCURLY, >> + JSON_LSQUARE, >> + JSON_RSQUARE, > > I might have used LBRACE and LBRACKET - but I also acknowledge that UK > spellers think of '()' for 'bracket'. Your naming is fine (unless you > really want that bikeshed to be chartreuse). I normally use (parenthesis), [bracket] and {brace} myself, but here I decided to stick to RFC 7159's wording: begin-array = ws %x5B ws ; [ left square bracket begin-object = ws %x7B ws ; { left curly bracket end-array = ws %x5D ws ; ] right square bracket end-object = ws %x7D ws ; } right curly bracket name-separator = ws %x3A ws ; : colon value-separator = ws %x2C ws ; , comma > Reviewed-by: Eric Blake Thanks!