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>
This commit is contained in:
Markus Armbruster 2019-09-27 15:46:22 +02:00
parent c9efc984ca
commit d7bc17c602
10 changed files with 25 additions and 4 deletions

View file

@ -1 +1,2 @@
tests/qapi-schema/redefined-event.json: In event 'EVENT_A':
tests/qapi-schema/redefined-event.json:3: event 'EVENT_A' is already defined