Skip to content

Commit

Permalink
qapi: Merge adjacent untagged sections
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Armbruster committed Feb 26, 2024
1 parent fedc04c commit 0b82a74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions scripts/qapi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions tests/qapi-schema/doc-empty-features.out
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0b82a74

Please sign in to comment.