qapi: Track location that created an implicit type
commit99df5289d8c7ebf373c3570d8fba3f3a73360281
authorEric Blake <eblake@redhat.com>
Tue, 13 Oct 2015 04:22:32 +0000 (12 22:22 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 15 Oct 2015 06:39:08 +0000 (15 08:39 +0200)
tree13fee73ef26c046ad443045e13b6e86a871c87f0
parent46292ba75c515baf733df18644052b2ce9492728
qapi: Track location that created an implicit type

A future patch will move some error checking from the parser
to the various QAPISchema*.check() methods, which run only
after parsing completes.  It will thus be possible to create
a python instance representing an implicit QAPI type that
parses fine but will fail validation during check().  Since
all errors have to have an associated 'info' location, we
need a location to be associated with those implicit types.
The intuitive info to use is the location of the enclosing
entity that caused the creation of the implicit type.

Note that we do not anticipate builtin types being used in
an error message (as they are not part of the user's QAPI
input, the user can't cause a semantic error in their
behavior), so we exempt those types from requiring info, by
setting a flag to track the completion of _def_predefineds(),
and tracking that flag in _def_entity().

No change to the generated code.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1444710158-8723-13-git-send-email-eblake@redhat.com>
[Missing QAPISchemaArrayType.is_implicit() supplied]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi.py