Prior to this patch, we always instantiate an empty Plain section. Removing this allows us to gradually phase out the "Plain" section in favor of "Intro" and "Details" sections while keeping "Plain" around for the interim churn during the series - meaning that we don't actually know at __init__ time which type of section we'll have first.
Signed-off-by: John Snow <[email protected]> --- scripts/qapi/parser.py | 4 +--- tests/qapi-schema/doc-good.out | 14 -------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index b21796b3e80..6612f471bb8 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -730,9 +730,7 @@ def __init__(self, info: QAPISourceInfo, symbol: Optional[str] = None): # definition doc's symbol, None for free-form doc self.symbol: Optional[str] = symbol # the sections in textual order - self.all_sections: List[QAPIDoc.Section] = [ - QAPIDoc.Section(info, QAPIDoc.Kind.PLAIN) - ] + self.all_sections: List[QAPIDoc.Section] = [] # dicts mapping parameter/feature names to their description self._args: Dict[str, QAPIDoc.ArgSection] = {} self._features: Dict[str, QAPIDoc.ArgSection] = {} diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out index e2be6f96bbf..6fcc8175cfe 100644 --- a/tests/qapi-schema/doc-good.out +++ b/tests/qapi-schema/doc-good.out @@ -106,8 +106,6 @@ Examples: - *verbatim* - {braces} doc symbol=Enum - section=Plain - arg=one The _one_ {and only}, description on the same line arg=two @@ -119,8 +117,6 @@ a member feature section=Plain @two is undocumented doc symbol=Base - section=Plain - arg=base1 description starts on a new line, minimally indented @@ -138,16 +134,10 @@ a feature feature=member-feat a member feature doc symbol=Variant2 - section=Plain - doc symbol=Object - section=Plain - feature=union-feat1 a feature doc symbol=Alternate - section=Plain - arg=i description starts on the same line remainder indented the same @@ -161,8 +151,6 @@ doc freeform Another subsection ================== doc symbol=cmd - section=Plain - arg=arg1 description starts on a new line, indented @@ -223,7 +211,5 @@ another feature <- ... has no title ... doc symbol=EVT_BOXED - section=Plain - feature=feat3 a feature -- 2.54.0
