All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/4] qobject: Correct JSON lexer grammar comments
Date: Fri, 17 Jun 2016 09:54:38 +0200	[thread overview]
Message-ID: <87oa70merl.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <5762E4D2.3090700@redhat.com> (Eric Blake's message of "Thu, 16 Jun 2016 11:41:38 -0600")

Eric Blake <eblake@redhat.com> writes:

> On 06/16/2016 10:19 AM, Markus Armbruster wrote:
>> Eric Blake <eblake@redhat.com> writes:
>> 
>>> Fix the regex comments describing what we parse as JSON.  No change
>>> to the lexer itself, just to the comments:
>>> - The "" and '' string construction was missing alternation between
>>> different escape sequences
>>> - The construction for numbers forgot to handle optional leading '-'
>>> - The construction for numbers was grouped incorrectly so that it
>>> didn't permit '0.1'
>>> - The construction for numbers forgot to mark the exponent as optional
>>> - No mention that our '' string and "\'" are JSON extensions
>>> - No mention of our %d and related extensions when constructing JSON
>>>
>>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> 
>> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>> 
>> I'll take this one through qapi-next.  Thanks!
>> 
>
> You may want to squash this in for shorter lines:
>
>
> diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c
> index de16219..b030576 100644
> --- a/qobject/json-lexer.c
> +++ b/qobject/json-lexer.c
> @@ -21,16 +21,14 @@
>   * Required by JSON (RFC 7159), plus \' extension in "", and extension
>   * of parsing case-insensitive non-finite numbers like "NaN" and "-Inf":
>   *
> - * \"([^\\\"]|(\\\"|\\'|\\\\|\\/|\\b|\\f|\\n|\\r|\\t|
> - *    \\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]))*\"
> + * \"([^\\\"]|\\[\"'\\/bfnrt]|\\u[0-9a-fA-F]{4})*\"
>   * -?(0|[1-9][0-9]*)(.[0-9]+)?([eE][-+]?[0-9]+)?
>   * [{}\[\],:]
>   * -?[a-zA-Z]+   # covers null, true, false, nan, inf[inity]
>   *
>   * Extension of '' strings:
>   *
> - * '([^\\']|(\\\"|\\'|\\\\|\\/|\\b|\\f|\\n|\\r|\\t|
> - *    \\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]))*'
> + * '([^\\']|\\[\"'\\/bfnrt]|\\u[0-9a-fA-F]{4})*'
>   *
>   * Extension for vararg handling in JSON construction:
>   *

Doesn't apply as is, but I get what you mean.  Applied to qapi-next,
please double-check the result there.  Thanks!

  reply	other threads:[~2016-06-17  7:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10  2:48 [Qemu-devel] [PATCH 0/4] Guarantee valid JSON in QMP, even for nonfinite numbers Eric Blake
2016-06-10  2:48 ` [Qemu-devel] [PATCH 1/4] qobject: Correct JSON lexer grammar comments Eric Blake
2016-06-16 16:19   ` Markus Armbruster
2016-06-16 17:41     ` Eric Blake
2016-06-17  7:54       ` Markus Armbruster [this message]
2016-06-21 13:53         ` Eric Blake
2016-06-10  2:48 ` [Qemu-devel] [PATCH 2/4] checkpatch: There is no qemu_strtod() Eric Blake
2016-06-16 16:20   ` Markus Armbruster
2016-06-16 16:31     ` Paolo Bonzini
2016-06-10  2:48 ` [Qemu-devel] [PATCH 3/4] qobject: Parse non-finite numbers, as an extension Eric Blake
2016-06-16 15:38   ` Markus Armbruster
2016-06-16 16:25     ` Markus Armbruster
2016-06-17  3:00       ` Eric Blake
2016-06-17  8:04         ` Markus Armbruster
2016-06-10  2:48 ` [Qemu-devel] [PATCH 4/4] qobject: Output valid JSON for non-finite numbers Eric Blake
2016-06-16 16:17   ` Markus Armbruster
2016-06-17  3:06     ` Eric Blake
2016-06-17  8:14       ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oa70merl.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.