[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 06/10] qapi: replace if condition list with dict {'all': [
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v7 06/10] qapi: replace if condition list with dict {'all': [...]} |
Date: |
Thu, 05 Aug 2021 18:06:04 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Markus Armbruster <armbru@redhat.com> writes:
> marcandre.lureau@redhat.com writes:
>
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> Replace the simple list sugar form with a recursive structure that will
>> accept other operators in the following commits (all, any or not).
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[...]
>> diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py
>> index cf98923fa6..b5187bfbca 100644
>> --- a/scripts/qapi/expr.py
>> +++ b/scripts/qapi/expr.py
>> @@ -259,14 +259,12 @@ def check_flags(expr: _JSONObject, info:
>> QAPISourceInfo) -> None:
>>
>> def check_if(expr: _JSONObject, info: QAPISourceInfo, source: str) -> None:
>> """
>> - Normalize and validate the ``if`` member of an object.
>> + Validate the ``if`` member of an object.
>>
>> - The ``if`` member may be either a ``str`` or a ``List[str]``.
>> - A ``str`` value will be normalized to ``List[str]``.
>> + The ``if`` member may be either a ``str`` or a dict.
>>
>> :forms:
>> - :sugared: ``Union[str, List[str]]``
>> - :canonical: ``List[str]``
>> + :canonical: ``Union[str, dict]``
>
> John hasn't answered my question whether :forms: makes sensw without
> :sugared:. If it doesn't, I can drop it in my tree.
We have a bunch of check_FOO(). Some normalize, and have :forms:. Some
don't, and don't have :forms:. This patch changes check_if() not to
normalize. So far, it leaves a degenerate :forms: behind. Let's drop
it. Can do in my tree.
[...]
[PATCH v7 09/10] qapi: add 'not' condition operation, marcandre . lureau, 2021/08/04
[PATCH v7 10/10] qapi: make 'if' condition strings simple identifiers, marcandre . lureau, 2021/08/04