• E
    qapi: Track location that created an implicit type · 99df5289
    Eric Blake 提交于
    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: NEric Blake <eblake@redhat.com>
    Message-Id: <1444710158-8723-13-git-send-email-eblake@redhat.com>
    [Missing QAPISchemaArrayType.is_implicit() supplied]
    Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
    99df5289
qapi.py 57.0 KB