qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org, Juan Quintela <quintela@redhat.com>
Subject: [PULL 1/5] qapi: Improve error message for description following section
Date: Wed, 17 May 2023 17:25:11 +0200	[thread overview]
Message-ID: <20230517152516.1884640-2-armbru@redhat.com> (raw)
In-Reply-To: <20230517152516.1884640-1-armbru@redhat.com>

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 <armbru@redhat.com>
Message-Id: <20230510141637.3685080-1-armbru@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
[Conflict with commit 3e32dca3f0d resolved]
---
 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 4923a59d60..acd43cd7e1 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -675,8 +675,8 @@ def _append_various_line(self, line: str) -> None:
         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():]
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



  reply	other threads:[~2023-05-17 15:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 15:25 [PULL 0/5] QAPI patches patches for 2023-05-17 Markus Armbruster
2023-05-17 15:25 ` Markus Armbruster [this message]
2023-05-17 15:25 ` [PATCH] qapi/parser: Drop two bad type hints for now Markus Armbruster
2023-05-17 15:25 ` [PULL 2/5] docs/interop: Convert qmp-spec.txt to rST Markus Armbruster
2023-05-17 15:25 ` [PULL 3/5] docs/interop/qmp-spec: Update error description for parsing errors Markus Armbruster
2023-05-17 15:25 ` [PULL 4/5] docs/interop: Delete qmp-intro.txt Markus Armbruster
2023-05-17 15:25 ` [PULL 5/5] qapi/parser: Drop two bad type hints for now Markus Armbruster
2023-05-17 17:44   ` Richard Henderson
2023-05-17 17:16 ` [PULL 0/5] QAPI patches patches for 2023-05-17 Richard Henderson
2023-05-17 18:35   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230517152516.1884640-2-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).