mbox series

[0/7] qapi: Refactor QAPISchemaVariants

Message ID 20240320074315.23167-1-armbru@redhat.com (mailing list archive)
Headers show
Series qapi: Refactor QAPISchemaVariants | expand

Message

Markus Armbruster March 20, 2024, 7:43 a.m. UTC
QAPISchemaVariants represents either a union type's branches, or an
alternate type's alternatives.  Much of its code is conditional on
which one it actually is.

This series moves the conditional code to new subtypes
QAPISchemaBranches and QAPISchemaAlternatives.

This also lets us treat QAPISchemaVariants.tag_member like the other
attribute that become known only in .check().

Markus Armbruster (7):
  qapi: New QAPISchemaBranches, QAPISchemaAlternatives
  qapi: Rename visitor parameter @variants to @branches
  qapi: Rename visitor parameter @variants to @alternatives
  qapi: Rename QAPISchemaObjectType.variants to .branches
  qapi: Rename QAPISchemaAlternateType.variants to .alternatives
  qapi: Move conditional code from QAPISchemaVariants to its subtypes
  qapi: Simplify QAPISchemaVariants @tag_member

 docs/sphinx/qapidoc.py         |  21 ++--
 scripts/qapi/commands.py       |   2 +-
 scripts/qapi/events.py         |   2 +-
 scripts/qapi/gen.py            |   2 +-
 scripts/qapi/introspect.py     |  15 +--
 scripts/qapi/schema.py         | 223 +++++++++++++++++----------------
 scripts/qapi/types.py          |  12 +-
 scripts/qapi/visit.py          |  24 ++--
 tests/qapi-schema/test-qapi.py |   9 +-
 9 files changed, 163 insertions(+), 147 deletions(-)