[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 18/56] json: Revamp lexer documentation
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 18/56] json: Revamp lexer documentation |
Date: |
Fri, 10 Aug 2018 16:31:24 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 08/08/2018 07:02 AM, Markus Armbruster wrote:
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>> qobject/json-lexer.c | 80 +++++++++++++++++++++++++++++++++++++++-----
>> 1 file changed, 71 insertions(+), 9 deletions(-)
>>
>
>> + *
>> + * [Numbers:]
>
> Worth also calling out:
>
> [Objects:]
> object = begin-object [ member *( value-separator member ) ]
> end-object
>
> member = string name-separator value
> [Arrays:]
> array = begin-array [ value *( value-separator value ) ] end-array
>
> so as to completely cover the RFC grammar?
Should this go into json-parser.c?
>> + *
>> + * Extensions over RFC 7159:
>> + * - Extra escape sequence in strings:
>> + * 0x27 (apostrophe) is recognized after escape, too
>> + * - Single-quoted strings:
>> + * Like double-quoted strings, except they're delimited by %x27
>> + * (apostrophe) instead of %x22 (quotation mark), and can't contain
>> + * unescaped apostrophe, but can contain unescaped quotation mark.
>> + * - Interpolation:
>> + * interpolation = %((l|ll|I64)[du]|[ipsf])
>
> Not in your series, but we recently discussed adding %% (only inside
> strings); coupled with enforcing that all other interpolation occurs
> outside of strings. I guess we can update this comment at that time.
Message-ID: <address@hidden>
https://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg05844.html
I meant to do that in this series, but got overwhelmed by all the other
stuff, and forgot. Thanks for the reminder. I may still do it in v2.
If not, we can do it on top.
>> + *
>> + * Note:
>> + * - Input must be encoded in UTF-8.
>> + * - Decoding and validating is left to the parser.
>> */
>> enum json_lexer_state {
>>
>
> Reviewed-by: Eric Blake <address@hidden>
Thanks!
- Re: [Qemu-devel] [PATCH 08/56] check-qjson: Streamline escaped_string()'s test strings, (continued)
[Qemu-devel] [PATCH 26/56] json: Simplify parse_string(), Markus Armbruster, 2018/08/08
[Qemu-devel] [PATCH 31/56] json-parser: simplify and avoid JSONParserContext allocation, Markus Armbruster, 2018/08/08
[Qemu-devel] [PATCH 43/56] qjson: Fix qobject_from_json() & friends for multiple values, Markus Armbruster, 2018/08/08
[Qemu-devel] [PATCH 12/56] check-qjson: Simplify utf8_string(), Markus Armbruster, 2018/08/08
[Qemu-devel] [PATCH 54/56] qobject: Drop superfluous includes of qemu-common.h, Markus Armbruster, 2018/08/08