mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-09 09:25:39 +00:00
qapi/common: Eliminate QAPISchema.exprs
Backports commit 71a7510baf8a5745eb844ab289f007ff8bbbee41 from qemu
This commit is contained in:
parent
3ab06081d4
commit
b859a59f49
|
@ -1470,13 +1470,13 @@ class QAPISchema(object):
|
||||||
def __init__(self, fname):
|
def __init__(self, fname):
|
||||||
try:
|
try:
|
||||||
parser = QAPISchemaParser(open(fname, 'r'))
|
parser = QAPISchemaParser(open(fname, 'r'))
|
||||||
self.exprs = check_exprs(parser.exprs)
|
exprs = check_exprs(parser.exprs)
|
||||||
self.docs = parser.docs
|
self.docs = parser.docs
|
||||||
self._entity_dict = {}
|
self._entity_dict = {}
|
||||||
self._predefining = True
|
self._predefining = True
|
||||||
self._def_predefineds()
|
self._def_predefineds()
|
||||||
self._predefining = False
|
self._predefining = False
|
||||||
self._def_exprs()
|
self._def_exprs(exprs)
|
||||||
self.check()
|
self.check()
|
||||||
except QAPIError as err:
|
except QAPIError as err:
|
||||||
print(err, file=sys.stderr)
|
print(err, file=sys.stderr)
|
||||||
|
@ -1661,8 +1661,8 @@ class QAPISchema(object):
|
||||||
name, info, doc, 'arg', self._make_members(data, info))
|
name, info, doc, 'arg', self._make_members(data, info))
|
||||||
self._def_entity(QAPISchemaEvent(name, info, doc, data, boxed))
|
self._def_entity(QAPISchemaEvent(name, info, doc, data, boxed))
|
||||||
|
|
||||||
def _def_exprs(self):
|
def _def_exprs(self, exprs):
|
||||||
for expr_elem in self.exprs:
|
for expr_elem in exprs:
|
||||||
expr = expr_elem['expr']
|
expr = expr_elem['expr']
|
||||||
info = expr_elem['info']
|
info = expr_elem['info']
|
||||||
doc = expr_elem.get('doc')
|
doc = expr_elem.get('doc')
|
||||||
|
|
Loading…
Reference in a new issue