qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 18/56] json: Revamp lexer documentation


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 18/56] json: Revamp lexer documentation
Date: Thu, 9 Aug 2018 13:49:56 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

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?

+ *
+ * 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.

+ *
+ * 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>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

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