qapi: Improve reporting of lexical errors
commit14c32795024c815316337b019bdf88d76b429af8
authorMarkus Armbruster <armbru@redhat.com>
Sat, 14 Sep 2019 15:34:55 +0000 (14 17:34 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 24 Sep 2019 12:07:23 +0000 (24 14:07 +0200)
tree95f3589c5ec7e15622843f3cdf588176743a3ba3
parent9f5e6b088a2d0b2b51e1cdf7c86f23f22d9ad493
qapi: Improve reporting of lexical errors

Show text up to next structural character, whitespace, or quote
character instead of just the first character.

Forgotten quotes now get reported like "Stray 'command'" instead of
"Stray 'c'".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190914153506.2151-9-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
scripts/qapi/common.py
tests/qapi-schema/bad-type-int.err
tests/qapi-schema/funny-word.err