qemu-e2k/scripts/qapi
John Snow 420110591c qapi/parser: add QAPIExpression type
This patch creates a new type, QAPIExpression, which represents a parsed
expression complete with QAPIDoc and QAPISourceInfo.

This patch turns parser.exprs into a list of QAPIExpression instead,
and adjusts expr.py to match.

This allows the types we specify in parser.py to be "remembered" all the
way through expr.py and into schema.py. Several assertions around
packing and unpacking this data can be removed as a result.

It also corrects a harmless typing error.  Before the patch,
check_exprs() allegedly takes a List[_JSONObject].  It actually takes
a list of dicts of the form

    {'expr': E, 'info': I, 'doc': D}

where E is of type _ExprValue, I is of type QAPISourceInfo, and D is
of type QAPIDoc.  Key 'doc' is optional.  This is not a _JSONObject!
Passes type checking anyway, because _JSONObject is Dict[str, object].

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20230215000011.1725012-5-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Commit message amended to point out the typing fix]
2023-02-23 13:01:45 +01:00
..
__init__.py
.flake8 qapi: Update flake8 config 2023-02-23 12:49:39 +01:00
.isort.cfg
commands.py qapi: Start to elide redundant has_FOO in generated C 2022-12-13 18:31:37 +01:00
common.py
error.py
events.py qapi: Start to elide redundant has_FOO in generated C 2022-12-13 18:31:37 +01:00
expr.py qapi/parser: add QAPIExpression type 2023-02-23 13:01:45 +01:00
gen.py qapi: Start to elide redundant has_FOO in generated C 2022-12-13 18:31:37 +01:00
introspect.py
main.py
mypy.ini
parser.py qapi/parser: add QAPIExpression type 2023-02-23 13:01:45 +01:00
pylintrc qapi: update pylint configuration 2023-02-23 12:49:39 +01:00
schema.py qapi/parser: add QAPIExpression type 2023-02-23 13:01:45 +01:00
source.py
types.py qapi: Start to elide redundant has_FOO in generated C 2022-12-13 18:31:37 +01:00
visit.py qapi: Start to elide redundant has_FOO in generated C 2022-12-13 18:31:37 +01:00