OSDN Git Service

qapi: Disentangle QAPIDoc code
authorKevin Wolf <kwolf@redhat.com>
Thu, 6 Jun 2019 15:38:00 +0000 (17:38 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 12 Jun 2019 16:35:31 +0000 (18:35 +0200)
commit03bf06bdc13c066a4703ab16e767dd91214969e3
tree8cab4ee3242b7a7e0b264b15a971eb970c0ade85
parenta00af404253729e025ccdca107c2bf2a4cff3bf9
qapi: Disentangle QAPIDoc code

Documentation comments follow a certain structure: First, we have a text
with a general description (called QAPIDoc.body). After this,
descriptions of the arguments follow. Finally, we have a part that
contains various named sections.

The code doesn't show this structure, but just checks various attributes
that indicate indirectly which part is being processed, so it happens to
do the right set of things in the right phase. This is hard to follow,
and adding support for documentation of features would be even harder.

This patch restructures the code so that the three parts are clearly
separated. The code becomes a bit longer, but easier to follow. The
resulting output remains unchanged.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20190606153803.5278-5-armbru@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/common.py