mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-25 23:38:04 +00:00
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. Backports commit 577de12d22aba55f31fd68c5724411eb8592a4ca from qemu
This commit is contained in:
parent
8b6a605685
commit
62f41569be
1 changed files with 7 additions and 4 deletions
|
@ -984,12 +984,10 @@ class QAPISchemaObjectType(QAPISchemaType):
|
|||
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 @@ class QAPISchemaObjectTypeMember(object):
|
|||
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):
|
||||
|
|
Loading…
Reference in a new issue