From 56c64dd60aebb9c856ab63de74c9e81acd079436 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 16 Feb 2024 15:58:33 +0100 Subject: qapi: Reject section heading in the middle of a doc comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docs/devel/qapi-code-gen.txt claims "A heading line must be the first line of the documentation comment block" since commit 55ec69f8b16 (docs/devel/qapi-code-gen.txt: Update to new rST backend conventions). Not true, we have code to make it work anywhere in a free-form doc comment: commit dcdc07a97cb (qapi: Make section headings start a new doc comment block). Make it true, for simplicity's sake. Signed-off-by: Markus Armbruster Message-ID: <20240216145841.2099240-10-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé --- scripts/qapi/parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/qapi/parser.py') diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index cc69f4f770..3aefec1c2b 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -440,9 +440,9 @@ class QAPISchemaParser: self, "unexpected '=' markup in definition documentation") if cur_doc.body.text: - cur_doc.end_comment() - docs.append(cur_doc) - cur_doc = QAPIDoc(self, info) + raise QAPIParseError( + self, + "'=' heading must come first in a comment block") cur_doc.append(self.val) self.accept(False) -- cgit 1.4.1