summary refs log tree commit diff stats
path: root/scripts/qapi/parser.py
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2024-02-16 15:58:37 +0100
committerMarkus Armbruster <armbru@redhat.com>2024-02-26 10:43:56 +0100
commit0b82a7440c22056745a925d0b1c070e18534aa0e (patch)
tree15e2a8f30582b8b1583dbedcd656cff6e60d9198 /scripts/qapi/parser.py
parentfedc04c9fcbd9802d21848b4d55c436c003f4961 (diff)
downloadfocaccia-qemu-0b82a7440c22056745a925d0b1c070e18534aa0e.tar.gz
focaccia-qemu-0b82a7440c22056745a925d0b1c070e18534aa0e.zip
qapi: Merge adjacent untagged sections
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>
Diffstat (limited to 'scripts/qapi/parser.py')
-rw-r--r--scripts/qapi/parser.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index de2ce3ec2c..48cc9a6367 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -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)