qapi: Improve reporting of invalid 'if' further
authorMarkus Armbruster <armbru@redhat.com>
Fri, 27 Sep 2019 13:46:35 +0000 (15:46 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Sat, 28 Sep 2019 15:17:45 +0000 (17:17 +0200)
commitfab12376d0234ce46517f88b9ecc9a6080522118
tree2f7e8fa0d631ebc779a81f7b8f364fe2b10574c8
parenteeb57c85da04b0c120562b25e3eac5cb16d8bf15
qapi: Improve reporting of invalid 'if' further

check_if()'s errors don't point to the offending part of the
expression.  For instance:

    tests/qapi-schema/alternate-branch-if-invalid.json:2: 'if' condition ' ' makes no sense

Other check_FOO() do, with the help of a @source argument.  Make
check_if() do that, too.  The example above improves to:

    tests/qapi-schema/alternate-branch-if-invalid.json:2: 'if' condition ' ' of 'data' member 'branch' makes no sense

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190927134639.4284-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
scripts/qapi/common.py
tests/qapi-schema/alternate-branch-if-invalid.err
tests/qapi-schema/bad-if-empty-list.err
tests/qapi-schema/bad-if-empty.err
tests/qapi-schema/bad-if-list.err
tests/qapi-schema/bad-if.err
tests/qapi-schema/enum-if-invalid.err
tests/qapi-schema/features-if-invalid.err
tests/qapi-schema/struct-member-if-invalid.err
tests/qapi-schema/union-branch-if-invalid.err