qemu-devel
[Top][All Lists]
Advanced

[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: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v3 for-2.5 05/12] qjson: Give each of the six structural chars its own token type
Date: Thu, 26 Nov 2015 09:22:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> 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 <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).

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 <address@hidden>

Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]