qapi: Normalize 'if' in check_exprs(), like other sugar
authorMarkus Armbruster <armbru@redhat.com>
Sat, 14 Sep 2019 15:35:00 +0000 (17:35 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 24 Sep 2019 12:07:23 +0000 (14:07 +0200)
commitfe9c4dcf9021f4111f37373bb71ef9e08863c349
tree2db890a0c3e3ea7b152d7c96ede68d13c5cec89c
parentdec0012ef8d644b5dde1b68ee8dab3f8c12e0b6b
qapi: Normalize 'if' in check_exprs(), like other sugar

We normalize shorthand to longhand forms in check_expr(): enumeration
values with normalize_enum(), feature values with
normalize_features(), struct members, union branches and alternate
branches with normalize_members().  If conditions are an exception: we
normalize them in QAPISchemaEntity.check() and
QAPISchemaMember.__init(), with listify_cond().  The idea goes back to
commit 2cbc94376e "qapi: pass 'if' condition into QAPISchemaEntity
objects", v3.0.0.

Normalize in check_expr() instead, with new helper normalize_if().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190914153506.2151-14-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
scripts/qapi/common.py