File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 78
78
79
79
80
80
class Transmogrifier :
81
+ # pylint: disable=too-many-public-methods
82
+
81
83
# Field names used for different entity types:
82
84
field_types = {
83
85
"enum" : "value" ,
@@ -362,6 +364,25 @@ def visit_freeform(self, doc: QAPIDoc) -> None:
362
364
self .add_lines (text , info )
363
365
self .ensure_blank_line ()
364
366
367
+ def visit_entity (self , ent : QAPISchemaDefinition ) -> None :
368
+ assert ent .info
369
+
370
+ try :
371
+ self ._curr_ent = ent
372
+
373
+ # Squish structs and unions together into an "object" directive.
374
+ meta = ent .meta
375
+ if meta in ("struct" , "union" ):
376
+ meta = "object"
377
+
378
+ # This line gets credited to the start of the /definition/.
379
+ self .add_line (f".. qapi:{ meta } :: { ent .name } " , ent .info )
380
+ with self .indented ():
381
+ self .preamble (ent )
382
+ self .visit_sections (ent )
383
+ finally :
384
+ self ._curr_ent = None
385
+
365
386
366
387
class QAPISchemaGenDepVisitor (QAPISchemaVisitor ):
367
388
"""A QAPI schema visitor which adds Sphinx dependencies each module
You can’t perform that action at this time.
0 commit comments