[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/13] qapi/parser: fix comment parsing immediately following
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 05/13] qapi/parser: fix comment parsing immediately following a doc block |
Date: |
Wed, 19 Jun 2024 14:04:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
John Snow <jsnow@redhat.com> writes:
> If a comment immediately follows a doc block, the parser doesn't ignore
> that token appropriately. Fix that.
>
> e.g.
>
>> ##
>> # = Hello World!
>> ##
>>
>> # I'm a comment!
>
> will break the parser, because it does not properly ignore the comment
> token if it immediately follows a doc block.
>
> Fixes: 3d035cd2cca6 (qapi: Rewrite doc comment parser)
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> scripts/qapi/parser.py | 2 +-
> tests/qapi-schema/doc-good.json | 2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
> index 43167ef0ab3..dfd6a6c5bee 100644
> --- a/scripts/qapi/parser.py
> +++ b/scripts/qapi/parser.py
> @@ -584,7 +584,7 @@ def get_doc(self) -> 'QAPIDoc':
> line = self.get_doc_line()
> first = False
>
> - self.accept(False)
> + self.accept()
> doc.end()
> return doc
>
> diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json
> index de38a386e8f..8b39eb946af 100644
> --- a/tests/qapi-schema/doc-good.json
> +++ b/tests/qapi-schema/doc-good.json
> @@ -55,6 +55,8 @@
> # - {braces}
> ##
>
> +# Not a doc comment
> +
> ##
> # @Enum:
> #
Reviewed-by: Markus Armbruster <armbru@redhat.com>
- Re: [PATCH 03/13] docs/qapidoc: delint a tiny portion of the module, (continued)
- [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections, John Snow, 2024/06/18
- Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections, Markus Armbruster, 2024/06/19
- Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections, John Snow, 2024/06/20
- Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections, Markus Armbruster, 2024/06/20
- Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections, John Snow, 2024/06/20
- Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections, Markus Armbruster, 2024/06/21
- Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections, John Snow, 2024/06/21
- Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections, Markus Armbruster, 2024/06/22
[PATCH 05/13] qapi/parser: fix comment parsing immediately following a doc block, John Snow, 2024/06/18
- Re: [PATCH 05/13] qapi/parser: fix comment parsing immediately following a doc block,
Markus Armbruster <=
[PATCH 06/13] docs/qapidoc: fix nested parsing under untagged sections, John Snow, 2024/06/18
[PATCH 07/13] qapi: fix non-compliant JSON examples, John Snow, 2024/06/18
[PATCH 08/13] qapi: ensure all errors sections are uniformly typset, John Snow, 2024/06/18
[PATCH 10/13] qapi: update prose in note blocks, John Snow, 2024/06/18
[PATCH 09/13] qapi: convert "Note" sections to plain rST, John Snow, 2024/06/18