Skip to content
Snippets Groups Projects
Commit 577de12d authored by Markus Armbruster's avatar Markus Armbruster
Browse files

qapi: Factor out QAPISchemaObjectTypeMember.check_clash()


While there, stick in a TODO change key of seen from QAPI name to C
name.  Can't do it right away, because it would fail the assertion for
tests/qapi-schema/args-has-clash.json.

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Message-Id: <1446559499-26984-6-git-send-email-armbru@redhat.com>
Signed-off-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <1447836791-369-10-git-send-email-eblake@redhat.com>
parent 23a4b2c6
No related branches found
No related tags found
No related merge requests found
......@@ -984,12 +984,10 @@ def check(self, schema):
assert not self.base.variants # not implemented
self.base.check(schema)
for m in self.base.members:
assert m.name not in seen
seen[m.name] = m
m.check_clash(seen)
for m in self.local_members:
m.check(schema)
assert m.name not in seen
seen[m.name] = m
m.check_clash(seen)
if self.variants:
self.variants.check(schema, seen)
self.members = seen.values()
......@@ -1030,6 +1028,11 @@ def check(self, schema):
self.type = schema.lookup_type(self._type_name)
assert self.type
def check_clash(self, seen):
# TODO change key of seen from QAPI name to C name
assert self.name not in seen
seen[self.name] = self
class QAPISchemaObjectTypeVariants(object):
def __init__(self, tag_name, tag_member, variants):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment