]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qapi: Merge adjacent untagged sections
authorMarkus Armbruster <armbru@redhat.com>
Fri, 16 Feb 2024 14:58:37 +0000 (15:58 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 26 Feb 2024 09:43:56 +0000 (10:43 +0100)
The parser mostly doesn't create adjacent untagged sections, and
merging the ones it does create is hardly worth the bother.  I'm doing
it to avoid behavioral change in the next commit.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240216145841.2099240-14-armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
scripts/qapi/parser.py
tests/qapi-schema/doc-empty-features.out

index de2ce3ec2cf4468ef9e512a594e570bd217bc368..48cc9a636747f53542de789f24a0058880f135d2 100644 (file)
@@ -719,6 +719,9 @@ class QAPIDoc:
         self._start_symbol_section(self.features, name)
 
     def _start_section(self, tag: Optional[str] = None) -> None:
+        if not tag and not self._section.tag:
+            # extend current section
+            return
         if tag in ('Returns', 'Since') and self.has_section(tag):
             raise QAPIParseError(self._parser,
                                  "duplicated '%s' section" % tag)
index 0f85623dde4be30f31cbaa5cd91489f2bd320266..473f59552dcf4bf1f483f48838c327d9d11bb6ef 100644 (file)
@@ -14,6 +14,4 @@ command foo None -> None
     gen=True success_response=True boxed=False oob=False preconfig=False
 doc symbol=foo
     body=
-
-    section=None
 not a description