qemu/scripts/qapi
Marc-André Lureau 967c885108 qapi: add 'if' to top-level expressions
Accept 'if' key in top-level elements, accepted as string or list of
string type. The following patches will modify the test visitor to
check the value is correctly saved, and generate #if/#endif code (as a
single #if/endif line or a series for a list).

Example of 'if' key:
{ 'struct': 'TestIfStruct', 'data': { 'foo': 'int' },
  'if': 'defined(TEST_IF_STRUCT)' }

The generated code is for now *unconditional*. Later patches generate
the conditionals.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180703155648.11933-2-marcandre.lureau@redhat.com>
[Commit message and Documentation improved]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2018-07-03 18:21:24 +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: introduce new cmd option "allow-preconfig" 2018-05-30 13:19:09 -03:00
common.py qapi: add 'if' to top-level expressions 2018-07-03 18:21:24 +02:00
doc.py qapi: introduce new cmd option "allow-preconfig" 2018-05-30 13:19:09 -03:00
events.py qapi/events: generate event enum in main module 2018-06-22 16:33:46 +02:00
introspect.py qapi/introspect: Eliminate pointless variable in .visit_end() 2018-06-22 16:33:47 +02:00
types.py qapi: allow empty branches in flat unions 2018-06-22 16:33:46 +02:00
visit.py qapi: allow empty branches in flat unions 2018-06-22 16:33:46 +02:00