[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/16] qapi: Merge adjacent untagged sections
From: |
Markus Armbruster |
Subject: |
[PATCH 13/16] qapi: Merge adjacent untagged sections |
Date: |
Fri, 16 Feb 2024 15:58:37 +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>
---
scripts/qapi/parser.py | 3 +++
tests/qapi-schema/doc-empty-features.out | 2 --
2 files changed, 3 insertions(+), 2 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 @@ def _start_features_section(self, name: str) -> None:
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)
diff --git a/tests/qapi-schema/doc-empty-features.out
b/tests/qapi-schema/doc-empty-features.out
index 0f85623dde..473f59552d 100644
--- a/tests/qapi-schema/doc-empty-features.out
+++ b/tests/qapi-schema/doc-empty-features.out
@@ -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
--
2.43.0
- [PATCH 09/16] qapi: Reject section heading in the middle of a doc comment, (continued)
- [PATCH 09/16] qapi: Reject section heading in the middle of a doc comment, Markus Armbruster, 2024/02/16
- [PATCH 11/16] qapi: Recognize section tags and 'Features:' only after blank line, Markus Armbruster, 2024/02/16
- [PATCH 06/16] qapi: Improve error position for bogus invalid "Returns" section, Markus Armbruster, 2024/02/16
- [PATCH 01/16] tests/qapi-schema: Fix test 'QAPI rST doc', Markus Armbruster, 2024/02/16
- [PATCH 05/16] qapi: Improve error position for bogus argument descriptions, Markus Armbruster, 2024/02/16
- [PATCH 13/16] qapi: Merge adjacent untagged sections,
Markus Armbruster <=
- [PATCH 16/16] qapi: Divorce QAPIDoc from QAPIParseError, Markus Armbruster, 2024/02/16
- [PATCH 03/16] tests/qapi-schema: Cover 'Features:' not followed by descriptions, Markus Armbruster, 2024/02/16
- [PATCH 15/16] qapi: Reject multiple and empty feature descriptions, Markus Armbruster, 2024/02/16
- [PATCH 08/16] qapi: Rename QAPIDoc.Section.name to .tag, Markus Armbruster, 2024/02/16
- [PATCH 02/16] tests/qapi-schema: Cover duplicate 'Features:' line, Markus Armbruster, 2024/02/16