[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 for-2.5 05/12] qjson: Give each of the six st
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v3 for-2.5 05/12] qjson: Give each of the six structural chars its own token type |
Date: |
Wed, 25 Nov 2015 15:05:55 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
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 <address@hidden>
> ---
> 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).
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v3 for-2.5 09/12] qjson: Convert to parser to recursive descent, (continued)
- [Qemu-devel] [PATCH v3 for-2.5 09/12] qjson: Convert to parser to recursive descent, Markus Armbruster, 2015/11/25
- [Qemu-devel] [PATCH v3 for-2.5 02/12] qjson: Don't crash when input exceeds nesting limit, Markus Armbruster, 2015/11/25
- [Qemu-devel] [PATCH v3 for-2.5 10/12] qjson: store tokens in a GQueue, Markus Armbruster, 2015/11/25
- [Qemu-devel] [PATCH v3 for-2.5 11/12] qjson: surprise, allocating 6 QObjects per token is expensive, Markus Armbruster, 2015/11/25
- [Qemu-devel] [PATCH v3 for-2.5 05/12] qjson: Give each of the six structural chars its own token type, Markus Armbruster, 2015/11/25
- Re: [Qemu-devel] [PATCH v3 for-2.5 05/12] qjson: Give each of the six structural chars its own token type,
Eric Blake <=