diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-09-25 17:23:00 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-09-29 17:55:39 +0200 |
commit | a69a6d4b4d4fae2e3d2506241e22a78ff1732283 (patch) | |
tree | 940fafbe098320e7daeb77ded94c8aa50042042d /tests/qapi-schema/meson.build | |
parent | 99dff36d3a5fb38bd3d079cd16b811bbfcb3ad07 (diff) | |
download | qemu-a69a6d4b4d4fae2e3d2506241e22a78ff1732283.zip qemu-a69a6d4b4d4fae2e3d2506241e22a78ff1732283.tar.gz qemu-a69a6d4b4d4fae2e3d2506241e22a78ff1732283.tar.bz2 |
scripts/qapi/parser.py: improve doc comment indent handling
Make the handling of indentation in doc comments more sophisticated,
so that when we see a section like:
Notes: some text
some more text
indented line 3
we save it for the doc-comment processing code as:
some text
some more text
indented line 3
and when we see a section with the heading on its own line:
Notes:
some text
some more text
indented text
we also accept that and save it in the same form.
If we detect that the comment document text is not indented as much
as we expect it to be, we throw a parse error. (We don't complain
about over-indented sections, because for rST this can be legitimate
markup.)
The golden reference for the doc comment text is updated to remove
the two 'wrong' indents; these now form a test case that we correctly
stripped leading whitespace from an indented multi-line argument
definition.
We update the documentation in docs/devel/qapi-code-gen.txt to
describe the new indentation rules.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20200925162316.21205-6-peter.maydell@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Whitespace between sentences tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema/meson.build')
-rw-r--r-- | tests/qapi-schema/meson.build | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index f144929..83a0a68 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -53,6 +53,7 @@ schemas = [ 'doc-bad-enum-member.json', 'doc-bad-event-arg.json', 'doc-bad-feature.json', + 'doc-bad-indent.json', 'doc-bad-section.json', 'doc-bad-symbol.json', 'doc-bad-union-member.json', |