Eric Blake <ebl...@redhat.com> 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 <arm...@redhat.com>
>> ---
>>  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 <ebl...@redhat.com>

Thanks!

Reply via email to