qemu/scripts/qapi
John Snow c7b7a7ded9 qapi: remove JSON value FIXME
With the two major JSON-ish type hierarchies clarified for distinct
purposes; QAPIExpression for parsed expressions and JSONValue for
introspection data, remove this FIXME as no longer an action item.

A third JSON-y data type, _ExprValue, is not meant to represent JSON in
the abstract but rather only the possible legal return values from a
single function, get_expr(). It isn't appropriate to attempt to merge it
with either of the above two types.

In theory, it may be possible to define a completely agnostic
one-size-fits-all JSON type hierarchy that any other user could borrow -
in practice, it's tough to wrangle the differences between invariant,
covariant and contravariant types: input and output parameters demand
different properties of such a structure.

However, QAPIExpression serves to authoritatively type user input to the
QAPI parser, while JSONValue serves to authoritatively type qapi
generator *output* to be served back to client users at runtime via
QMP. The AST for these two types are different and cannot be wholly
merged into a unified syntax.

They could, in theory, share some JSON primitive definitions. In
practice, this is currently more trouble than it's worth with mypy's
current expressive power. As such, declare this "done enough for now".

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20230215000011.1725012-7-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
2023-02-23 13:01:45 +01:00
..
.flake8 qapi: Update flake8 config 2023-02-23 12:49:39 +01:00
.isort.cfg qapi: enforce import order/styling with isort 2020-10-10 11:37:47 +02:00
__init__.py qapi-gen: New common driver for code and doc generators 2018-03-02 13:14:09 -06:00
commands.py qapi: Start to elide redundant has_FOO in generated C 2022-12-13 18:31:37 +01:00
common.py qapi: Avoid generating C identifier 'linux' 2022-07-13 12:19:18 +03:00
error.py qapi/error: Add type hints 2021-04-30 12:59:54 +02:00
events.py qapi: Start to elide redundant has_FOO in generated C 2022-12-13 18:31:37 +01:00
expr.py qapi: remove _JSONObject 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 qapi: Add feature flags to enum members 2021-10-27 17:18:55 +02:00
main.py qapi: generate trace events by default 2022-01-27 15:17:35 +01:00
mypy.ini qapi/parser: enable mypy checks 2021-10-02 07:33:42 +02:00
parser.py qapi: remove JSON value FIXME 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 qapi/source: Remove line number from QAPISourceInfo initializer 2021-05-20 11:28:27 +02:00
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