qapi/parser: add mea culpa comment for ensure_returns

These algorithms are quite a mess currently, but they are temporary
until we add the inliner which will address these issues more
holistically. For now, add the "mea culpa".

Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20260611042332.482979-10-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
John Snow
2026-06-11 00:23:28 -04:00
committed by Markus Armbruster
parent 6a1c092b01
commit 7a22b0da5b

View File

@@ -866,6 +866,13 @@ class QAPIDoc:
self._features[feature.name].connect(feature)
def ensure_returns(self, info: QAPISourceInfo) -> None:
# This is more complicated than it ought to be. The doc
# parser should already know where a generated RETURNS section
# should go. It currently doesn't, mostly because it accepts
# tagged sections in any order.
#
# TODO: Tighten doc syntax and simplify.
if any(s.kind == QAPIDoc.Kind.RETURNS for s in self.all_sections):
return