Skip to content

Commit f5ec5ad

Browse files
authored
Update syntax.rst
1 parent 3b5f3de commit f5ec5ad

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

doc/syntax.rst

+10-9
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ Range Format Specifications
491491
Format specifications for range types have the following syntax:
492492

493493
.. productionlist:: sf
494-
range_format_spec: [":" ["n"][`range_type`][`range_underlying_spec`]]
494+
range_format_spec: ["n"][`range_type`][`range_underlying_spec`]
495495

496496
The ``'n'`` option formats the range without the opening and closing brackets.
497497

@@ -500,23 +500,24 @@ The available presentation types for `range_type` are:
500500
+---------+----------------------------------------------------------+
501501
| Type | Meaning |
502502
+=========+==========================================================+
503+
| none | Default format. |
504+
+---------+----------------------------------------------------------+
503505
| ``'s'`` | String format. The range is formatted as a string. |
504506
+---------+----------------------------------------------------------+
505507
| ``'?s'``| Debug format. The range is formatted as an escaped |
506508
| | string. |
507509
+---------+----------------------------------------------------------+
508-
| none | Default format. The range is formatted with a separator. |
509-
+---------+----------------------------------------------------------+
510510

511-
If `range_type` is ``'s'`` or ``'?s'``, the range element type must be a character type. The
512-
``'n'`` option and `range_underlying_spec` are mutually exclusive with ``'s'`` and ``'?s'``.
511+
If `range_type` is ``'s'`` or ``'?s'``, the range element type must be a
512+
character type. The ``'n'`` option and `range_underlying_spec` are mutually
513+
exclusive with ``'s'`` and ``'?s'``.
513514

514515
The `range_underlying_spec` is parsed based on the formatter of the range's
515-
reference type.
516+
element type.
516517

517-
By default, a range of characters or strings is printed escaped and quoted. But
518-
if any `range_underlying_spec` is provided (even if it is empty), then the characters
519-
or strings are printed according to the provided specification.
518+
By default, a range of characters or strings is printed escaped and quoted.
519+
But if any `range_underlying_spec` is provided (even if it is empty), then
520+
the characters or strings are printed according to the provided specification.
520521

521522
Examples::
522523

0 commit comments

Comments
 (0)