qapi/parser: fix comment parsing immediately following a doc block
commit83deda876940116d31bf47c51e62e0fe625e8655
authorJohn Snow <jsnow@redhat.com>
Wed, 26 Jun 2024 22:21:12 +0000 (26 18:21 -0400)
committerMarkus Armbruster <armbru@redhat.com>
Sat, 6 Jul 2024 06:58:24 +0000 (6 08:58 +0200)
tree09c5300b9d78d9222d57e2c7f1f91137bfd38bba
parent939c639e1d7c1d78bcc262368ab1fb78f09d0bfe
qapi/parser: fix comment parsing immediately following a doc block

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>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240626222128.406106-7-jsnow@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/parser.py
tests/qapi-schema/doc-good.json