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>
This commit is contained in:
parent
939c639e1d
commit
83deda8769
@ -583,7 +583,7 @@ class QAPISchemaParser:
|
|||||||
line = self.get_doc_line()
|
line = self.get_doc_line()
|
||||||
first = False
|
first = False
|
||||||
|
|
||||||
self.accept(False)
|
self.accept()
|
||||||
doc.end()
|
doc.end()
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
|
@ -55,6 +55,8 @@
|
|||||||
# - {braces}
|
# - {braces}
|
||||||
##
|
##
|
||||||
|
|
||||||
|
# Not a doc comment
|
||||||
|
|
||||||
##
|
##
|
||||||
# @Enum:
|
# @Enum:
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user