[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.9 16/47] qapi2texi: Convert to QAPISchemaV
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH for-2.9 16/47] qapi2texi: Convert to QAPISchemaVisitor |
Date: |
Tue, 14 Mar 2017 12:31:56 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 03/13/2017 01:18 AM, Markus Armbruster wrote:
> qapi2texi works with schema expression trees. Such a tight coupling
> to schema language syntax is not a good idea. Convert it to the visitor
> interface the other generators use.
>
> No change to generated documentation.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> scripts/qapi2texi.py | 228
> ++++++++++++++++++++++++++-------------------------
> 1 file changed, 118 insertions(+), 110 deletions(-)
>
> + def visit_object_type(self, name, info, base, members, variants):
> + doc = self.cur_doc
> + if not variants:
> + typ = 'Struct'
> + elif variants._tag_name: # TODO unclean member access
> + typ = 'Flat Union'
> + else:
> + typ = 'Simple Union'
Do we even want to document this distinction to the end user?
Introspection managed to hide the difference by introducing the
appropriate generated wrapper types that demonstrate the additional {}
nesting in a way compatible with rewriting simple unions into flat
unions. If we don't explain the difference here, we can get rid of the
unclean member access, but then again risk documentation that is not
clear whether {} nesting is needed.
I guess there's also the fact that for this patch, you intentionally
tried to make no difference to the generated docs (good); so any tweaks
to union output should be later patches anyways.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH for-2.9 24/47] qapi2texi: Implement boxed argument documentation, (continued)
- [Qemu-devel] [PATCH for-2.9 25/47] qapi2texi: Include member type in generated documentation, Markus Armbruster, 2017/03/13
- [Qemu-devel] [PATCH for-2.9 15/47] qapi: Conjure up QAPIDoc.ArgSection for undocumented members, Markus Armbruster, 2017/03/13
- [Qemu-devel] [PATCH for-2.9 16/47] qapi2texi: Convert to QAPISchemaVisitor, Markus Armbruster, 2017/03/13
- Re: [Qemu-devel] [PATCH for-2.9 16/47] qapi2texi: Convert to QAPISchemaVisitor,
Eric Blake <=
- [Qemu-devel] [PATCH for-2.9 30/47] tests/qapi-schema: Improve doc / expression mismatch coverage, Markus Armbruster, 2017/03/13
- [Qemu-devel] [PATCH for-2.9 47/47] qapi: Fix a misleading parser error message, Markus Armbruster, 2017/03/13
- [Qemu-devel] [PATCH for-2.9 32/47] qapi: Move detection of doc / expression name mismatch, Markus Armbruster, 2017/03/13
- [Qemu-devel] [PATCH for-2.9 40/47] qapi: Simplify what gets stored in enum_types, Markus Armbruster, 2017/03/13