[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/20] qapi/source: allow multi-line QAPISourceInfo advancing
From: |
John Snow |
Subject: |
[PATCH 12/20] qapi/source: allow multi-line QAPISourceInfo advancing |
Date: |
Tue, 14 May 2024 17:57:31 -0400 |
This is for the sake of the new rST generator (the "transmogrifier") so
we can advance multiple lines on occasion while keeping the
generated<-->source mappings accurate.
next_line now simply takes an optional n parameter which chooses the
number of lines to advance.
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/source.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi/source.py b/scripts/qapi/source.py
index 7b379fdc925..ffdc3f482ac 100644
--- a/scripts/qapi/source.py
+++ b/scripts/qapi/source.py
@@ -47,9 +47,9 @@ def set_defn(self, meta: str, name: str) -> None:
self.defn_meta = meta
self.defn_name = name
- def next_line(self: T) -> T:
+ def next_line(self: T, n: int = 1) -> T:
info = copy.copy(self)
- info.line += 1
+ info.line += n
return info
def loc(self) -> str:
--
2.44.0
- Re: [PATCH 08/20] qapi/parser: differentiate intro and outro paragraphs, (continued)
[PATCH 09/20] qapi/parser: add undocumented stub members to all_sections, John Snow, 2024/05/14
[PATCH 13/20] docs/qapidoc: fix nested parsing under untagged sections, John Snow, 2024/05/14
[PATCH 05/20] qapi/parser: adjust info location for doc body section, John Snow, 2024/05/14
[PATCH 11/20] qapi/schema: add doc_visible property to QAPISchemaDefinition, John Snow, 2024/05/14
[PATCH 15/20] qapi: remove developer factoring comments from QAPI doc blocks, John Snow, 2024/05/14
[PATCH 12/20] qapi/source: allow multi-line QAPISourceInfo advancing,
John Snow <=
[PATCH 16/20] qapi: rewrite StatsFilter comment, John Snow, 2024/05/14
[PATCH 14/20] qapi: fix non-compliant JSON examples, John Snow, 2024/05/14
[PATCH 17/20] qapi: rewrite BlockExportOptions doc block, John Snow, 2024/05/14
[PATCH 18/20] qapi: ensure all errors sections are uniformly typset, John Snow, 2024/05/14
[PATCH 19/20] qapi: convert "Note" sections to plain rST, John Snow, 2024/05/14
[PATCH 20/20] qapi: convert "Example" sections to rST, John Snow, 2024/05/14
Re: [PATCH 00/20] qapi: new sphinx qapi domain pre-requisites, Stefan Hajnoczi, 2024/05/16