OptsVisitor: introduce unit tests, with test cases for range flattening
According to commit 4f193e34("tests: Use qapi-schema-test.json as schema parser test")the "tests/qapi-schema/qapi-schema-test.out" file must be updated as well.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>...
qapi.py: Reject invalid characters in schema file
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Message-id: 1374939721-7876-6-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi.py: Fix schema parser to check syntax systematically
Fixes at least the following parser bugs:
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
qapi.py: Fix diagnosing non-objects at a schema's top-level
Report syntax error instead of crashing.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Message-id: 1374939721-7876-8-git-send-email-armbru@redhat.com...
qapi.py: Permit comments starting anywhere on the line
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Message-id: 1374939721-7876-10-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
tests: QAPI schema parser tests
The parser handles erroneous input badly. To be improved shortly.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1374939721-7876-2-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
tests: Use qapi-schema-test.json as schema parser test
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Message-id: 1374939721-7876-3-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi.py: Restructure lexer and parser
The parser has a rather unorthodox structure:
Until EOF:
Read a section:
Generator function get_expr() yields one section after the other, as a string. An unindented, non-empty line that...
qapi.py: Decent syntax error reporting
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Message-id: 1374939721-7876-5-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
View revisions
Also available in: Atom