The error message is bad when the section is untagged. For instance, test case doc-interleaved-section produces "'@foobar:' can't follow 'Note' section", which is okay, but if we drop the "Note:" tag, we get "'@foobar:' can't follow 'None' section, which is bad.
Change the error message to "description of '@foobar:' follows a section". Signed-off-by: Markus Armbruster <arm...@redhat.com> --- scripts/qapi/parser.py | 4 ++-- tests/qapi-schema/doc-interleaved-section.err | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 878f90b458..3de467493f 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -700,8 +700,8 @@ def _append_various_line(self, line: str) -> None: if name.startswith('@') and name.endswith(':'): raise QAPIParseError(self._parser, - "'%s' can't follow '%s' section" - % (name, self.sections[0].name)) + "description of '%s' follows a section" + % name) if self._is_section_tag(name): # If line is "Section: first line of description", find # the index of 'f', which is the indent we expect for any diff --git a/tests/qapi-schema/doc-interleaved-section.err b/tests/qapi-schema/doc-interleaved-section.err index 715d58cd31..e5d1ef54c1 100644 --- a/tests/qapi-schema/doc-interleaved-section.err +++ b/tests/qapi-schema/doc-interleaved-section.err @@ -1 +1 @@ -doc-interleaved-section.json:15:1: '@foobar:' can't follow 'Note' section +doc-interleaved-section.json:15:1: description of '@foobar:' follows a section -- 2.39.2