From 290e48e8f1ec975c100520fb697b0ae7300d0fb3 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 10 May 2023 16:16:37 +0200 Subject: qapi: Improve error message for description following section 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 Message-Id: <20230510141637.3685080-1-armbru@redhat.com> Reviewed-by: Juan Quintela [Conflict with commit 3e32dca3f0d resolved] --- scripts/qapi/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 1ff334e6a8..22e7bcc4b1 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -675,8 +675,8 @@ class QAPIDoc: match = self._match_at_name_colon(line) if match: raise QAPIParseError(self._parser, - "'@%s:' can't follow '%s' section" - % (match.group(1), self.sections[0].name)) + "description of '@%s:' follows a section" + % match.group(1)) match = self._match_section_tag(line) if match: line = line[match.end():] -- cgit v1.2.3