[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/27] qapi: Inline check_name() into check_union()
From: |
Markus Armbruster |
Subject: |
[PULL 16/27] qapi: Inline check_name() into check_union() |
Date: |
Sat, 28 Sep 2019 20:39:23 +0200 |
check_name() consists of check_name_is_str() and check_name_str().
check_union() relies on the latter to catch optional discriminators.
The next commit will replace that by a more straightforward check.
Inlining check_name() into check_union() now should make that easier
to review.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
---
scripts/qapi/common.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 88945804dc..9acff01d3e 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -897,8 +897,10 @@ def check_union(expr, info):
# The value of member 'discriminator' must name a non-optional
# member of the base struct.
- check_name(discriminator, info,
- "discriminator of flat union '%s'" % name)
+ check_name_is_str(discriminator, info,
+ "discriminator of flat union '%s'" % name)
+ check_name_str(discriminator, info,
+ "discriminator of flat union '%s'" % name)
discriminator_value = base_members.get(discriminator)
if not discriminator_value:
raise QAPISemError(info,
--
2.21.0
- [PULL 27/27] qapi: Improve source file read error handling, (continued)
- [PULL 27/27] qapi: Improve source file read error handling, Markus Armbruster, 2019/09/28
- [PULL 19/27] qapi: Improve reporting of invalid 'if' errors, Markus Armbruster, 2019/09/28
- [PULL 20/27] qapi: Improve reporting of invalid flags, Markus Armbruster, 2019/09/28
- [PULL 18/27] qapi: Move context-free checking to the proper place, Markus Armbruster, 2019/09/28
- [PULL 24/27] qapi: Eliminate check_keys(), rename check_known_keys(), Markus Armbruster, 2019/09/28
- [PULL 21/27] qapi: Improve reporting of missing / unknown definition keys, Markus Armbruster, 2019/09/28
- [PULL 23/27] qapi: Improve reporting of invalid 'if' further, Markus Armbruster, 2019/09/28
- [PULL 17/27] qapi: Move context-sensitive checking to the proper place, Markus Armbruster, 2019/09/28
- [PULL 03/27] qapi: Rename .owner to .defined_in, Markus Armbruster, 2019/09/28
- [PULL 04/27] qapi: New QAPISourceInfo, replacing dict, Markus Armbruster, 2019/09/28
- [PULL 16/27] qapi: Inline check_name() into check_union(),
Markus Armbruster <=
- [PULL 06/27] qapi: Clean up member name case checking, Markus Armbruster, 2019/09/28
- [PULL 12/27] qapi: Report invalid '*' prefix like any other invalid name, Markus Armbruster, 2019/09/28
- [PULL 25/27] qapi: Improve reporting of missing documentation comment, Markus Armbruster, 2019/09/28
- [PULL 09/27] qapi: Reorder check_FOO() parameters for consistency, Markus Armbruster, 2019/09/28
- [PULL 08/27] qapi: Improve reporting of member name clashes, Markus Armbruster, 2019/09/28
- [PULL 26/27] qapi: Improve reporting of redefinition, Markus Armbruster, 2019/09/28
- [PULL 15/27] qapi: Plumb info to the QAPISchemaMember, Markus Armbruster, 2019/09/28
- [PULL 05/27] qapi: Prefix frontend errors with an "in definition" line, Markus Armbruster, 2019/09/28
- [PULL 22/27] qapi: Avoid redundant definition references in error messages, Markus Armbruster, 2019/09/28
- [PULL 07/27] qapi: Change frontend error messages to start with lower case, Markus Armbruster, 2019/09/28