]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qapi: lift restriction on using '=' in doc blocks
authorJohn Snow <jsnow@redhat.com>
Wed, 18 Jun 2025 16:53:53 +0000 (12:53 -0400)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 14 Jul 2025 08:08:27 +0000 (10:08 +0200)
We reject lines starting with '=' in definition documentation.  This
made sense when such lines were headings in free-form documentation,
but not in definition documentation.

Before the previous commit, lines starting with '=' were headings in
free-form documentation, and rejected in definition documentation,
where such headings could not work.

The previous commit dropped the headings feature from free-form
documentation, because we can simply use plain rST headings.
Rejecting them in definition documentation no longer makes sense, so
drop that, too.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20250618165353.1980365-6-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Amend commit message to explain why]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/parser.py
tests/qapi-schema/doc-bad-section.err [deleted file]
tests/qapi-schema/doc-bad-section.json [deleted file]
tests/qapi-schema/doc-bad-section.out [deleted file]
tests/qapi-schema/meson.build

index aad7e249f867ed3bdc93e806ec41b58056d9002b..d43a123cd74fe5e73cf5efb1285abdb3649e5849 100644 (file)
@@ -584,10 +584,6 @@ class QAPISchemaParser:
                         doc.append_line(text)
                     line = self.get_doc_indented(doc)
                     no_more_args = True
-                elif line.startswith('='):
-                    raise QAPIParseError(
-                        self,
-                        "unexpected '=' markup in definition documentation")
                 else:
                     # plain paragraph
                     doc.ensure_untagged_section(self.info)
diff --git a/tests/qapi-schema/doc-bad-section.err b/tests/qapi-schema/doc-bad-section.err
deleted file mode 100644 (file)
index 785cacc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-doc-bad-section.json:5:1: unexpected '=' markup in definition documentation
diff --git a/tests/qapi-schema/doc-bad-section.json b/tests/qapi-schema/doc-bad-section.json
deleted file mode 100644 (file)
index 8175d95..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# = section within an expression comment
-
-##
-# @Enum:
-# == No good here
-# @one: The _one_ {and only}
-#
-# @two is undocumented
-##
-{ 'enum': 'Enum', 'data': [ 'one', 'two' ] }
diff --git a/tests/qapi-schema/doc-bad-section.out b/tests/qapi-schema/doc-bad-section.out
deleted file mode 100644 (file)
index e69de29..0000000
index 9577178b6ffb95a7d15793c7616547b20b93205d..c47025d16d864e95b09e530ef0eaf698e868006d 100644 (file)
@@ -61,7 +61,6 @@ schemas = [
   'doc-bad-event-arg.json',
   'doc-bad-feature.json',
   'doc-bad-indent.json',
-  'doc-bad-section.json',
   'doc-bad-symbol.json',
   'doc-bad-union-member.json',
   'doc-before-include.json',