[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 19/32] qapi: Accept double-quoted strings
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [RFC PATCH 19/32] qapi: Accept double-quoted strings |
Date: |
Fri, 06 Oct 2017 07:29:19 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Marc-André Lureau <address@hidden> writes:
> On Thu, Oct 5, 2017 at 6:41 AM, Markus Armbruster <address@hidden> wrote:
>> Marc-André Lureau <address@hidden> writes:
>>
>>> On Mon, Oct 2, 2017 at 5:25 PM, Markus Armbruster <address@hidden> wrote:
>>>> The QAPI schema parser has always accepted only single-quoted strings,
>>>> even though JSON strings are double-quoted. Accept double-quoted
>>>> strings as well, so you can write strings containing single quotes
>>>> without backslash escapes.
>>>>
>>>> Signed-off-by: Markus Armbruster <address@hidden>
>>>
>>> What's the motivation to allow both? If we were to switch from single
>>> to double quote only, that would make more sense.
>>
>> Abandoning single quotes now would require us to touch pretty much every
>> line of code in the schemas. I don't think correcting quotes is worth
>> wrecking git-blame.
>>
>
> Recent (and upcoming) changes to the schema are already quite
> invasive. I think we could do it, convert all strings to double-quote,
> and it would help with getting the schema closer to a valid json.
Is the recent (and upcoming) churn *that* bad? Got numbers?
> Fwiw, there are tools like
> https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html
> to skip commits in git-blame. It's also fairly easy to run git blame
> before the reformatting commit.
Both techniques add friction...
>> Sadly, the schema language is neither JSON, nor an established extension
>> of JSON, nor Python. This commit brings the schema language one step
>> closer to a superset of JSON. I feel "homegrown superset" is a slightly
>> less bad idea than "homegrown with large overlap".
>>
>> Naming the schema files .json was in bad taste.
>>
>>> otherwise, patch looks good
>>
>> Ready to upgrade to R-by now?
>>
>> Want me to work more of my rationale into the commit message?
- [Qemu-devel] [RFC PATCH 31/32] qapi/options: QAPIfy --blockdev argument type, (continued)
- [Qemu-devel] [RFC PATCH 31/32] qapi/options: QAPIfy --blockdev argument type, Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 05/32] qapi2texi: Provide access to Texinfo markup, Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 21/32] qapi: Define QAPIOptionKind and QAPIOption automatically, Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 23/32] qapi-options: Command line option backend, Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 25/32] qapi-introspect: Include command line options information, Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 20/32] qapi: Frontend for defining command line options, Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 19/32] qapi: Accept double-quoted strings, Markus Armbruster, 2017/10/02
[Qemu-devel] [RFC PATCH 12/32] qapi: Use argparse to parse command line arguments, Markus Armbruster, 2017/10/02
[Qemu-devel] [RFC PATCH 17/32] qapi: Fix simple union lowering with multiple schemas, Markus Armbruster, 2017/10/02
[Qemu-devel] [RFC PATCH 15/32] tests/qapi-schema: Improve simple union coverage, Markus Armbruster, 2017/10/02
[Qemu-devel] [RFC PATCH 11/32] qapi: Drop the options to generate only .c or .h, Markus Armbruster, 2017/10/02