This website requires JavaScript.
Explore
Help
Register
Sign In
xemu-project
/
xemu
Watch
1
Star
0
Fork
0
You've already forked xemu
mirror of
https://github.com/xemu-project/xemu.git
synced
2024-11-24 03:59:52 +00:00
Code
Issues
Actions
Packages
Projects
Releases
Wiki
Activity
dc1d91ac56
xemu
/
tests
/
qapi-schema
/
double-type.json
3 lines
101 B
JSON
Raw
Normal View
History
Unescape
Escape
qapi: Better error messages for bad expressions The previous commit demonstrated that the generator overlooked some fairly basic broken expressions: - missing metataype - metatype key has a non-string value - unknown key in relation to the metatype - conflicting metatype (this patch treats the second metatype as an unknown key of the first key visited, which is not necessarily the first key the user typed) Add check_keys to cover these situations, and update testcases to match. A couple other tests (enum-missing-data, indented-expr) had to change since the validation added here occurs so early. Conversely, changes to ident-with-escape results show that we still have problems where our handling of escape sequences differs from true JSON, which will matter down the road if we allow arbitrary default string values for optional parameters (but for now is not too bad, as we currently can avoid unicode escaping as we don't need to represent anything beyond C identifier material). While valid .json files won't trigger any of these cases, we might as well be nicer to developers that make a typo while trying to add new QAPI code. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-05-04 15:05:15 +00:00
#
w
e
r
e
j
e
c
t
a
n
e
x
p
r
e
s
s
i
o
n
w
i
t
h
a
m
b
i
g
u
o
u
s
m
e
t
a
t
y
p
e
qapi: Use 'struct' instead of 'type' in schema 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. Do the bulk of the conversion to "struct" in qapi schema, with a fairly mechanical: for f in `find -name '*.json'; do sed -i "s/'type'/'struct'/"; done followed by manually filtering out the places where we have a 'type' embedded in 'data'. Then tweak a couple of tests whose output changes slightly due to longer lines. I also verified that the generated files for QMP and QGA (such as qmp-commands.h) are the same before and after, as assurance that I didn't leave in any accidental member name changes. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-05-04 15:05:27 +00:00
{
'
c
o
m
m
a
n
d
'
:
'
f
o
o
'
,
'
s
t
r
u
c
t
'
:
'
b
a
r
'
,
'
d
a
t
a
'
:
{
}
}
Reference in New Issue
Copy Permalink