Skip to content

Commit bc361f2

Browse files
author
Markus Armbruster
committed
docs/sphinx/qmp_lexer: Generalize elision syntax
Accept "... lorem ipsum ..." in addition to "...". Signed-off-by: Markus Armbruster <[email protected]> Message-ID: <[email protected]> Reviewed-by: Eric Blake <[email protected]>
1 parent e27608d commit bc361f2

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

docs/devel/qapi-code-gen.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,9 @@ used.
10291029
QMP Examples can be added by using the ``.. qmp-example::`` directive.
10301030
In its simplest form, this can be used to contain a single QMP code
10311031
block which accepts standard JSON syntax with additional server
1032-
directionality indicators (``->`` and ``<-``), and elisions (``...``).
1032+
directionality indicators (``->`` and ``<-``), and elisions. An
1033+
elision is commonly ``...``, but it can also be or a pair of ``...``
1034+
with text in between.
10331035

10341036
Optionally, a plaintext title may be provided by using the ``:title:``
10351037
directive option. If the title is omitted, the example title will
@@ -1062,7 +1064,7 @@ For example::
10621064
# "device": "ide0-hd0",
10631065
# ...
10641066
# }
1065-
# ...
1067+
# ... more ...
10661068
# ] }
10671069
#
10681070
# Above, lengthy output has been omitted for brevity.

docs/sphinx/qmp_lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class QMPExampleMarkersLexer(RegexLexer):
2424
'root': [
2525
(r'-> ', token.Generic.Prompt),
2626
(r'<- ', token.Generic.Prompt),
27-
(r' ?\.{3} ?', token.Generic.Prompt),
27+
(r'\.{3}( .* \.{3})?', token.Generic.Prompt),
2828
]
2929
}
3030

tests/qapi-schema/doc-good.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
#
213213
# -> "this example"
214214
#
215-
# <- "has no title"
215+
# <- ... has no title ...
216216
##
217217
{ 'command': 'cmd-boxed', 'boxed': true,
218218
'data': 'Object',

tests/qapi-schema/doc-good.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ another feature
217217

218218
-> "this example"
219219

220-
<- "has no title"
220+
<- ... has no title ...
221221
doc symbol=EVT_BOXED
222222
body=
223223

tests/qapi-schema/doc-good.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ Example::
264264

265265
-> "this example"
266266

267-
<- "has no title"
267+
<- ... has no title ...
268268

269269

270270
"EVT_BOXED" (Event)

0 commit comments

Comments
 (0)