On Mon, Feb 17, 2025 at 6:55 AM Markus Armbruster <arm...@redhat.com> wrote:
> John Snow <js...@redhat.com> writes: > > > This clarifies sections that are mistaken by the parser as "intro" > > sections to be "details" sections instead. > > > > Signed-off-by: John Snow <js...@redhat.com> > > --- > > qapi/machine.json | 2 ++ > > qapi/migration.json | 4 ++++ > > qapi/qom.json | 4 ++++ > > qapi/yank.json | 2 ++ > > scripts/qapi/parser.py | 8 ++++++++ > > 5 files changed, 20 insertions(+) > > Missing updates for the new syntax > > * Documentation: docs/devel/qapi-code-gen.rst > > * Positive test case(s): tests/qapi-schema/doc-good.json > > * Maybe a negative test case for _tag_check() failure > > Understood; I wasn't entirely sure if this concept would fly, so I saved the polish and you got an RFC quality patch. Forgive me, please! If you think this approach is fine, I will certainly do all the things you outlined above. > [...] > > > diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py > > index c5d2b950a82..5890a13b5ba 100644 > > --- a/scripts/qapi/parser.py > > +++ b/scripts/qapi/parser.py > > @@ -544,6 +544,14 @@ def _tag_check(what: str) -> None: > > raise QAPIParseError( > > self, 'feature descriptions expected') > > have_tagged = True > > + elif line == 'Details:': > > + _tag_check("Details") > > This one. > ACK > > > + self.accept(False) > > + line = self.get_doc_line() > > + while line == '': > > + self.accept(False) > > + line = self.get_doc_line() > > + have_tagged = True > > elif match := self._match_at_name_colon(line): > > # description > > if have_tagged: > >