qapi: Improve reporting of invalid name errors
commitd7bc17c602f128bb358376e6976b3b5dee1ad732
authorMarkus Armbruster <armbru@redhat.com>
Fri, 27 Sep 2019 13:46:22 +0000 (27 15:46 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Sat, 28 Sep 2019 15:17:18 +0000 (28 17:17 +0200)
treedcb866d6555d49919c90479e62de679e36c3b966
parentc9efc984ca5b5f75f184680e1ab9a7784d241578
qapi: Improve reporting of invalid name errors

Split check_name() into check_name_is_str() and check_name_str(), keep
check_name() as a wrapper.

Move add_name()'s call into its caller check_exprs(), and inline.

This permits delaying check_name_str() there, so its error message
gains an "in definition" line.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190927134639.4284-10-armbru@redhat.com>
scripts/qapi/common.py
tests/qapi-schema/bad-ident.err
tests/qapi-schema/command-int.err
tests/qapi-schema/redefined-builtin.err
tests/qapi-schema/redefined-command.err
tests/qapi-schema/redefined-event.err
tests/qapi-schema/redefined-type.err
tests/qapi-schema/reserved-command-q.err
tests/qapi-schema/reserved-type-kind.err
tests/qapi-schema/reserved-type-list.err