qapi: replace if condition list with dict {'all': [...]}
commit5d83b9a130690f879d5f33e991beabe69cb88bc8
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 4 Aug 2021 08:31:01 +0000 (4 12:31 +0400)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 26 Aug 2021 11:53:56 +0000 (26 13:53 +0200)
treeec68563193b1bbaafb4614a08e15845d33f8d7d9
parentd806f89f87152def5f422e946c84948831615236
qapi: replace if condition list with dict {'all': [...]}

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>
Message-Id: <20210804083105.97531-7-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Accidental code motion undone.  Degenerate :forms: comment dropped.
Helper _check_if() moved.  Error messages tweaked.  ui.json updated.
Accidental changes to qapi-schema-test.json dropped.]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
27 files changed:
qapi/ui.json
scripts/qapi/common.py
scripts/qapi/expr.py
scripts/qapi/schema.py
tests/qapi-schema/bad-if-all.err [new file with mode: 0644]
tests/qapi-schema/bad-if-all.json [new file with mode: 0644]
tests/qapi-schema/bad-if-all.out [new file with mode: 0644]
tests/qapi-schema/bad-if-empty-list.json
tests/qapi-schema/bad-if-key.err [new file with mode: 0644]
tests/qapi-schema/bad-if-key.json [copied from tests/qapi-schema/bad-if.json with 77% similarity]
tests/qapi-schema/bad-if-key.out [new file with mode: 0644]
tests/qapi-schema/bad-if-keys.err [new file with mode: 0644]
tests/qapi-schema/bad-if-keys.json [new file with mode: 0644]
tests/qapi-schema/bad-if-keys.out [new file with mode: 0644]
tests/qapi-schema/bad-if-list.json
tests/qapi-schema/bad-if.err
tests/qapi-schema/bad-if.json
tests/qapi-schema/doc-good.json
tests/qapi-schema/doc-good.out
tests/qapi-schema/doc-good.txt
tests/qapi-schema/enum-if-invalid.err
tests/qapi-schema/features-if-invalid.err
tests/qapi-schema/meson.build
tests/qapi-schema/qapi-schema-test.json
tests/qapi-schema/qapi-schema-test.out
tests/qapi-schema/struct-member-if-invalid.err
tests/qapi-schema/union-branch-if-invalid.json