diff options
author | Eric Blake <eblake@redhat.com> | 2015-05-04 09:05:25 -0600 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-05-05 18:39:01 +0200 |
commit | fd41dd4eae5f7ea92f10c04cb3f217727fcee91f (patch) | |
tree | 04cf70812be04f55d4a4aa5cd770a7ab5b1ec6eb /tests/qapi-schema/flat-union-branch-clash.out | |
parent | 2cbf09925ad45401673a79ab77f67de2f04a826c (diff) |
qapi: Prefer 'struct' over 'type' in generator
Referring to "type" as both a meta-type (built-in, enum, union,
alternate, or struct) and a specific type (the name that the
schema uses for declaring structs) is confusing. The confusion
is only made worse by the fact that the generator mostly already
refers to struct even when dealing with expr['type']. This
commit changes the generator to consistently refer to it as
struct everywhere, plus a single back-compat tweak that allows
accepting the existing .json files as-is, so that the meat of
this change is separate from the mindless churn of that change.
Fix the testsuite fallout for error messages that change, and
in some cases, become more legible. Improve comments to better
match our intentions where a struct (rather than any complex
type) is required. Note that in some cases, an error message
now refers to 'struct' while the schema still refers to 'type';
that will be cleaned up in the later commit to the schema.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema/flat-union-branch-clash.out')
-rw-r--r-- | tests/qapi-schema/flat-union-branch-clash.out | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/qapi-schema/flat-union-branch-clash.out b/tests/qapi-schema/flat-union-branch-clash.out index 5d541133b9..04c239565e 100644 --- a/tests/qapi-schema/flat-union-branch-clash.out +++ b/tests/qapi-schema/flat-union-branch-clash.out @@ -1,9 +1,9 @@ [OrderedDict([('enum', 'TestEnum'), ('data', ['value1', 'value2'])]), - OrderedDict([('type', 'Base'), ('data', OrderedDict([('enum1', 'TestEnum'), ('name', 'str')]))]), - OrderedDict([('type', 'Branch1'), ('data', OrderedDict([('name', 'str')]))]), - OrderedDict([('type', 'Branch2'), ('data', OrderedDict([('value', 'int')]))]), + OrderedDict([('struct', 'Base'), ('data', OrderedDict([('enum1', 'TestEnum'), ('name', 'str')]))]), + OrderedDict([('struct', 'Branch1'), ('data', OrderedDict([('name', 'str')]))]), + OrderedDict([('struct', 'Branch2'), ('data', OrderedDict([('value', 'int')]))]), OrderedDict([('union', 'TestUnion'), ('base', 'Base'), ('discriminator', 'enum1'), ('data', OrderedDict([('value1', 'Branch1'), ('value2', 'Branch2')]))])] [{'enum_name': 'TestEnum', 'enum_values': ['value1', 'value2']}] -[OrderedDict([('type', 'Base'), ('data', OrderedDict([('enum1', 'TestEnum'), ('name', 'str')]))]), - OrderedDict([('type', 'Branch1'), ('data', OrderedDict([('name', 'str')]))]), - OrderedDict([('type', 'Branch2'), ('data', OrderedDict([('value', 'int')]))])] +[OrderedDict([('struct', 'Base'), ('data', OrderedDict([('enum1', 'TestEnum'), ('name', 'str')]))]), + OrderedDict([('struct', 'Branch1'), ('data', OrderedDict([('name', 'str')]))]), + OrderedDict([('struct', 'Branch2'), ('data', OrderedDict([('value', 'int')]))])] |