All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH v2 16/16] qapi: Tweak code to match docs/devel/qapi-code-gen.txt
Date: Tue, 10 Sep 2019 08:37:24 +0200	[thread overview]
Message-ID: <20190910063724.28470-17-armbru@redhat.com> (raw)
In-Reply-To: <20190910063724.28470-1-armbru@redhat.com>

The previous commit made qapi-code-gen.txt define "(top-level)
expression" as either "directive" or "definition".  The code still
uses "expression" when it really means "definition".  Tidy up.

The previous commit made qapi-code-gen.txt use "object" rather than
"dictionary".  The code still uses "dictionary".  Tidy up.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/common.py                        | 24 +++++++++----------
 tests/qapi-schema/args-invalid.err            |  2 +-
 tests/qapi-schema/doc-missing.err             |  2 +-
 tests/qapi-schema/doc-no-symbol.err           |  2 +-
 .../qapi-schema/enum-dict-member-unknown.err  |  2 +-
 tests/qapi-schema/pragma-non-dict.err         |  2 +-
 tests/qapi-schema/struct-data-invalid.err     |  2 +-
 7 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index f4630a5dd3..e86d196e5f 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -103,11 +103,11 @@ class QAPISemError(QAPIError):
 
 class QAPIDoc(object):
     """
-    A documentation comment block, either expression or free-form
+    A documentation comment block, either definition or free-form
 
-    Expression documentation blocks consist of
+    Definition documentation blocks consist of
 
-    * a body section: one line naming the expression, followed by an
+    * a body section: one line naming the definition, followed by an
       overview (any number of lines)
 
     * argument sections: a description of each argument (for commands
@@ -200,9 +200,9 @@ class QAPIDoc(object):
         Process a line of documentation text in the body section.
 
         If this a symbol line and it is the section's first line, this
-        is an expression documentation block for that symbol.
+        is a definition documentation block for that symbol.
 
-        If it's an expression documentation block, another symbol line
+        If it's a definition documentation block, another symbol line
         begins the argument section for the argument named by it, and
         a section tag begins an additional section.  Start that
         section and append the line to it.
@@ -220,7 +220,7 @@ class QAPIDoc(object):
             if not self.symbol:
                 raise QAPIParseError(self._parser, "Invalid name")
         elif self.symbol:
-            # This is an expression documentation block
+            # This is a definition documentation block
             if name.startswith('@') and name.endswith(':'):
                 self._append_line = self._append_args_line
                 self._append_args_line(line)
@@ -428,7 +428,7 @@ class QAPISchemaParser(object):
                 pragma = expr['pragma']
                 if not isinstance(pragma, dict):
                     raise QAPISemError(
-                        info, "Value of 'pragma' must be a dictionary")
+                        info, "Value of 'pragma' must be an object")
                 for name, value in pragma.items():
                     self._pragma(name, value, info)
             else:
@@ -437,7 +437,7 @@ class QAPISchemaParser(object):
                 if cur_doc:
                     if not cur_doc.symbol:
                         raise QAPISemError(
-                            cur_doc.info, "Expression documentation required")
+                            cur_doc.info, "Definition documentation required")
                     expr_elem['doc'] = cur_doc
                 self.exprs.append(expr_elem)
             cur_doc = None
@@ -786,7 +786,7 @@ def check_type(info, source, value,
 
     if not isinstance(value, OrderedDict):
         raise QAPISemError(info,
-                           "%s should be a dictionary or type name" % source)
+                           "%s should be an object or type name" % source)
 
     # value is a dictionary, check that each member is okay
     for (key, arg) in value.items():
@@ -968,8 +968,8 @@ def check_enum(expr, info):
                            "Enum '%s' requires a string for 'prefix'" % name)
 
     for member in members:
-        source = "dictionary member of enum '%s'" % name
-        check_known_keys(info, source, member, ['name'], ['if'])
+        check_known_keys(info, "member of enum '%s'" % name, member,
+                         ['name'], ['if'])
         check_if(member, info)
         check_name(info, "Member of enum '%s'" % name, member['name'],
                    enum_member=True)
@@ -1078,7 +1078,7 @@ def check_exprs(exprs):
 
         if not doc and doc_required:
             raise QAPISemError(info,
-                               "Expression missing documentation comment")
+                               "Definition missing documentation comment")
 
         if 'enum' in expr:
             meta = 'enum'
diff --git a/tests/qapi-schema/args-invalid.err b/tests/qapi-schema/args-invalid.err
index fe1e94975b..bfb2e4133e 100644
--- a/tests/qapi-schema/args-invalid.err
+++ b/tests/qapi-schema/args-invalid.err
@@ -1 +1 @@
-tests/qapi-schema/args-invalid.json:1: 'data' for command 'foo' should be a dictionary or type name
+tests/qapi-schema/args-invalid.json:1: 'data' for command 'foo' should be an object or type name
diff --git a/tests/qapi-schema/doc-missing.err b/tests/qapi-schema/doc-missing.err
index 7f2f326b30..3a377ddc57 100644
--- a/tests/qapi-schema/doc-missing.err
+++ b/tests/qapi-schema/doc-missing.err
@@ -1 +1 @@
-tests/qapi-schema/doc-missing.json:5: Expression missing documentation comment
+tests/qapi-schema/doc-missing.json:5: Definition missing documentation comment
diff --git a/tests/qapi-schema/doc-no-symbol.err b/tests/qapi-schema/doc-no-symbol.err
index 75f032a942..212984ff20 100644
--- a/tests/qapi-schema/doc-no-symbol.err
+++ b/tests/qapi-schema/doc-no-symbol.err
@@ -1 +1 @@
-tests/qapi-schema/doc-no-symbol.json:3: Expression documentation required
+tests/qapi-schema/doc-no-symbol.json:3: Definition documentation required
diff --git a/tests/qapi-schema/enum-dict-member-unknown.err b/tests/qapi-schema/enum-dict-member-unknown.err
index 2aae618be0..7fd9c032bf 100644
--- a/tests/qapi-schema/enum-dict-member-unknown.err
+++ b/tests/qapi-schema/enum-dict-member-unknown.err
@@ -1,2 +1,2 @@
-tests/qapi-schema/enum-dict-member-unknown.json:2: Unknown key 'bad-key' in dictionary member of enum 'MyEnum'
+tests/qapi-schema/enum-dict-member-unknown.json:2: Unknown key 'bad-key' in member of enum 'MyEnum'
 Valid keys are 'if', 'name'.
diff --git a/tests/qapi-schema/pragma-non-dict.err b/tests/qapi-schema/pragma-non-dict.err
index 75bc335aea..b358261050 100644
--- a/tests/qapi-schema/pragma-non-dict.err
+++ b/tests/qapi-schema/pragma-non-dict.err
@@ -1 +1 @@
-tests/qapi-schema/pragma-non-dict.json:3: Value of 'pragma' must be a dictionary
+tests/qapi-schema/pragma-non-dict.json:3: Value of 'pragma' must be an object
diff --git a/tests/qapi-schema/struct-data-invalid.err b/tests/qapi-schema/struct-data-invalid.err
index 6644f4c2ad..4bf5bcc255 100644
--- a/tests/qapi-schema/struct-data-invalid.err
+++ b/tests/qapi-schema/struct-data-invalid.err
@@ -1 +1 @@
-tests/qapi-schema/struct-data-invalid.json:1: 'data' for struct 'foo' should be a dictionary or type name
+tests/qapi-schema/struct-data-invalid.json:1: 'data' for struct 'foo' should be an object or type name
-- 
2.21.0



  parent reply	other threads:[~2019-09-10  6:48 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10  6:37 [Qemu-devel] [PATCH v2 00/16] qapi: Schema language cleanups & doc improvements Markus Armbruster
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 01/16] scripts/git.orderfile: Match QAPI schema more precisely Markus Armbruster
2019-09-10  6:56   ` Philippe Mathieu-Daudé
2019-09-10 13:41   ` Eric Blake
2019-09-13 14:14     ` Markus Armbruster
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 02/16] qapi: Drop check_type()'s redundant parameter @allow_optional Markus Armbruster
2019-09-10 13:45   ` Eric Blake
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 03/16] qapi: Drop support for boxed alternate arguments Markus Armbruster
2019-09-10 14:54   ` Eric Blake
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 04/16] docs/devel/qapi-code-gen: Minor specification fixes Markus Armbruster
2019-09-10 15:10   ` Eric Blake
2019-09-13 14:23     ` Markus Armbruster
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 05/16] tests/qapi-schema: Demonstrate bad reporting of funny characters Markus Armbruster
2019-09-10 15:12   ` Eric Blake
2019-09-13 14:24     ` Markus Armbruster
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 06/16] qapi: Restrict strings to printable ASCII Markus Armbruster
2019-09-10 15:22   ` Eric Blake
2019-09-13 14:28     ` Markus Armbruster
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 07/16] qapi: Drop support for escape sequences other than \\ Markus Armbruster
2019-09-10 15:28   ` Eric Blake
2019-09-13 14:38     ` Markus Armbruster
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 08/16] qapi: Permit 'boxed' with empty type Markus Armbruster
2019-09-10 16:28   ` Eric Blake
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 09/16] qapi: Permit alternates with just one branch Markus Armbruster
2019-09-10 16:30   ` Eric Blake
2019-09-13 14:47     ` Markus Armbruster
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 10/16] qapi: Permit omitting all flat union branches Markus Armbruster
2019-09-10 16:32   ` Eric Blake
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 11/16] qapi: Adjust frontend errors to say enum value, not member Markus Armbruster
2019-09-10 16:33   ` Eric Blake
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 12/16] docs/devel/qapi-code-gen: Reorder sections for readability Markus Armbruster
2019-09-10 16:36   ` Eric Blake
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 13/16] docs/devel/qapi-code-gen: Rewrite compatibility considerations Markus Armbruster
2019-09-10 16:42   ` Eric Blake
2019-09-13 15:05     ` Markus Armbruster
2019-09-17 16:11       ` Eric Blake
2019-09-23 11:44         ` Markus Armbruster
2019-09-23 13:00           ` Eric Blake
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 14/16] docs/devel/qapi-code-gen: Rewrite introduction to schema Markus Armbruster
2019-09-10 16:50   ` Eric Blake
2019-09-13 15:16     ` Markus Armbruster
2019-09-10  6:37 ` [Qemu-devel] [PATCH v2 15/16] docs/devel/qapi-code-gen: Improve QAPI schema language doc Markus Armbruster
2019-09-10 17:37   ` Eric Blake
2019-09-13 15:39     ` Markus Armbruster
2019-09-17 16:14       ` Eric Blake
2019-09-23 11:45         ` Markus Armbruster
2019-09-10  6:37 ` Markus Armbruster [this message]
2019-09-10 17:45   ` [Qemu-devel] [PATCH v2 16/16] qapi: Tweak code to match docs/devel/qapi-code-gen.txt Eric Blake
2019-09-10  7:09 ` [Qemu-devel] [PATCH v2 00/16] qapi: Schema language cleanups & doc improvements no-reply
2019-09-10 22:32 ` no-reply

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=20190910063724.28470-17-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.